六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

ADO 2.6 vs. the ADO.NET

[摘要]ADO 2.6 vs. the ADO.NET 在本例中我們需要IIS5環(huán)境、Visual Studio.NET BETA1、還有SQL SERVER中的Northwind數(shù)據(jù)庫 在.NET中,保持...
ADO 2.6 vs. the ADO.NET
在本例中我們需要IIS5環(huán)境、Visual Studio.NET BETA1、還有SQL SERVER中的Northwind數(shù)據(jù)庫
在.NET中,保持了對早先COM及基于COM技術的良好支持,在本例中提供了兩種方法:GetCustomersOld() 使用了ADO2.6;GetCustomersNew() 使用ADO.NET,可以對比。

namespace PROINFO.WebService.Data
{
using System;
using System.Collections;
using System.Configuration;
using System.ComponentModel;
using System.Data;
using System.Data.SQL;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
/// <summary>
/// Summary description for WS.
/// </summary>
public class WS : System.Web.Services.WebService
{
public WS()
{
//CODEGEN: This call is required by the ASP+ Web Services Designer
InitializeComponent();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
public override void Dispose()
{
}

// Here starts the example code
public struct sCustomers
{
public String sCustomerID;
public String sCompanyName;
public String sContactName;
public String sContactTitle;
public String sAddress;
public String sCity;
public String sRegion;
public String sPostalCode;
public String sCountry;
public String sPhone;
public String sFax;
}

[WebMethod(Description="ADO 2.6 WebMethod Example")]
public sCustomers[] GetCustomersOld()
{
ADODB.Connection cn = new ADODB.Connection();
ADODB.Recordset rs = new ADODB.Recordset();
String strSQL;
int intRC;
int intCnt;
strSQL = "SELECT * FROM Customers";
cn.Open("Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=Northwind;", "sa", null, 0);
rs.Open(strSQL, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, 0);
intRC = rs.RecordCount;
if (intRC < 1)
{
return null;
}
sCustomers[] c = new sCustomers[intRC];
rs.MoveFirst();
intCnt = 0;

while (!rs.EOF)
{
c[intCnt].sCustomerID = rs.Fields["CustomerID"].Value.ToString();
c[intCnt].sCompanyName = rs.Fields["CompanyName"].Value.ToString();
c[intCnt].sContactName = rs.Fields["ContactName"].Value.ToString();
c[intCnt].sContactTitle = rs.Fields["ContactTitle"].Value.ToString();
c[intCnt].sAddress = rs.Fields["Address"].Value.ToString();
c[intCnt].sCity = rs.Fields["City"].Value.ToString();
c[intCnt].sRegion = rs.Fields["Region"].Value.ToString();
c[intCnt].sPostalCode = rs.Fields["PostalCode"].Value.ToString();
c[intCnt].sCountry = rs.Fields["Country"].Value.ToString();
c[intCnt].sPhone = rs.Fields["Phone"].Value.ToString();
c[intCnt].sFax = rs.Fields["Fax"].Value.ToString();
rs.MoveNext();
intCnt++;
}
return c;
}

[WebMethod(Description="ADO.NET WebMethod Example")]
public DataSet GetCustomersNew()
{
DataSet ds = new DataSet();
SQLConnection cn = new SQLConnection("localhost", "sa", "", "Northwind");
cn.Open();
SQLDataSetCommand cm = new SQLDataSetCommand("SELECT * FROM Customers", cn);
cm.FillDataSet(ds, "Customers");
return ds;
}
}
}


主站蜘蛛池模板: 五月激情久久 | 亚洲天堂精品在线观看 | 香蕉视频网页 | 五月婷婷深深爱 | 日日夜夜爽 | 日本免费网站视频 | 亚洲一区二区三区精品影院 | 日韩三级在线 | 亚洲免费在线观看 | 片免费观看网站视频 | 日本在线视频二区 | 天天噜夜夜操 | 日韩a级毛片免费视频 | 亚洲欧洲在线观看 | 亚洲视频在线免费观看 | 五月天婷婷在线视频国产在线 | 日日操夜夜添 | 欧美一级做一a做片性视频 欧美一级做性受 | 最近最新免费中文字幕一 | 香蕉啪啪 | 亚洲国产欧美在线成人aaaa | 日韩精品福利在线 | 日韩免费一区二区三区在线 | 偷窥自拍亚洲色图 | 青青热在线观看视频精品 | 亚洲成a人片在线观看播放 亚洲成a人片在线观看www | 思思99re热| 日韩一级黄色大片 | 天天躁日日躁狠狠躁综合 | 日本不卡高清免费 | 思思久久99 | 亚洲成人社 | 五月激情丁香婷婷综合第九 | 欧美又粗又长 | 欧美小网站 | 污视频在线 | 四虎精品成人免费影视 | 亚洲天堂伦理 | 日韩啪啪网| 日韩欧美黄色片 | 天天综合网天天综合色 |