设为首页】 【加入收藏】 【网站地图】 【商品折扣
娱乐一生 娱乐明星
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
首页  |  java  |  .NET  |  C/C++  |  网页技术  |  php  |  asp  |  delphi  |  VC  |  VB开发  |  游戏开发  |  软件工程  |  Power Builder  |  Linux开发  |  Windows开发技巧
当前位置:首页 >> ASP文摘 >> ADO 2.6 vs. the ADO.NET_ASP文摘_src119.com

ADO 2.6 vs. the ADO.NET_ASP文摘_src119.com -

ADO 2.6 vs. the ADO.NET
在本例中我们需要IIS5环境、Visual Studio.NET BETA1、还有SQL SERVER中的Northwind数据库
在.NET中,保持了对早先COM及基于COM技术的良好支持,在本例中提供了两种方法:GetCustomersOld() 使用了ADO2.6;GetCustomer ew() 使用ADO.NET,可以对比。

name ace PROINFO.We ervice.Data
{
using System;
using System.Collectio 
using System.Configuratio 
using System.ComponentModel;
using System.Data;
using System.Data.SQL;
using System.Diagnostic 
using System.We 
using System.Web.Service 
/// < ummary>
/// Summary description for WS.
/// </summary>
public cla  WS : System.Web.Services.We ervice
{
public WS()
{
//CODEGEN: This call is required by the A + Web Services Designer
InitializeComponent();
}
/// < ummary>
/// Required method for Designer su ort - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// < ummary>
/// Clean up any resources being used.
/// </summary>
public override void Di ose()
{
}

// Here starts the example code
public struct sCustomers
{
public String sCustomerID;
public String sCompanyName;
public String sContactName;
public String sContactTitle;
public String sAddre 
public String sCity;
public String sRegio 
public String  ostalCode;
public String sCountry;
public String  hone;
public String sFax;
}

[WebMethod(Description="ADO 2.6 WebMethod Example")]
public sCustomers[] GetCustomersOld()
{
ADODB.Co ection cn = new ADODB.Co ection();
ADODB.Recordset rs = new ADODB.Recordset();
String strSQL;
int intRC;
int intCnt;
strSQL = " ELECT * FROM Customer quot 
cn.Open(" rovider=SQLOLED  Data Source=SERVER; Initial Catalog=Northwind quot;, " a", null, 0);
rs.Open(strSQL, cn, ADODB.CursorTypeEnum.adOpe tatic, 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].sAddre  = rs.Fields["Addre quot;].Value.ToString();
c[intCnt].sCity = rs.Fields["City"].Value.ToString();
c[intCnt].sRegion = rs.Fields["Regio quot;].Value.ToString();
c[intCnt]. ostalCode = rs.Fields[" ostalCode"].Value.ToString();
c[intCnt].sCountry = rs.Fields["Country"].Value.ToString();
c[intCnt]. hone = rs.Fields[" hone"].Value.ToString();
c[intCnt].sFax = rs.Fields["Fax"].Value.ToString();
rs.MoveNext();
intCnt++;
}
return c;
}

[WebMethod(Description="ADO.NET WebMethod Example")]
public DataSet GetCustomer ew()
{
DataSet ds = new DataSet();
SQLCo ection cn = new SQLCo ection("localhost", " a", " quot;, " orthwind");
cn.Open();
SQLDataSetCommand cm = new SQLDataSetCommand(" ELECT * FROM Customer quot;, cn);
cm.FillDataSet(ds, "Customer quot;);
return d 
}
}
}



 

娱乐图摘

更多 >>

靓丽清纯美女meimei

美女私房全裸照
导演劝女演员脱衣服(视频)

大胆火辣人体艺术写真(图)

黑丝妹妹热辣诱惑-丝袜美女妹妹

PLMM 漂亮妹妹图集-妹妹图库

全球美女图库-美女集中营

52MM 我爱漂亮妹妹-制服妹妹诱惑

图王图库-世界美女明星图片资料库
美女写真集锦

激情两性-解密性生活
浴室MM湿身内衣诱惑
邻家小妹洗澡被偷拍(视频)

热点文章

更多

· ASP+和JSP之间的抉择_ASP文摘_src119.com
· ASP.NET强大的性能(一)_ASP文摘_src119.c
· 构建稳定的服务器端组件的七个步骤_ASP开发_Web开发_软
· asp编写的加密和解密类_ASP开发_Web开发_软件开发
· WAP中的ASP技术之五_ASP开发_Web开发_软件开发
· 用ASP制作强大的搜索引擎_ASP开发_Web开发_软件开发
· 精彩OUTLOOK 2000组件放送_ASP开发_Web开发
· 访问数据库(6)_ASP开发_Web开发_软件开发
· .net的reflection (1) _ASP文
· RC4经典加密算法VB版本代码_ASP开发_Web开发_软件

热点文章

更多