我爱Aspx >> Asp.Net >> ADO.NET中的多数据表操作之读取Select orderID,OrderDate,CustomerID FROM orders Where CustomerID IN
(Select CustomerID FROM Customers Where CustomerID LIKE 'A%')
Select orderID,ProductID,UnitPrice,Quantity,Discount FROM [Order Details] Where orderID IN
(Select orderID FROM orders Where CustomerID IN
(Select CustomerID FROM Customers Where CustomerID LIKE 'A%'))
GO
为了减少数据量,这里只取了CustomerID以’A’开头的数据。建立DataAccess类来管理窗体同数据层的交互:
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
namespace WinformTest
{
public class DataAccess
{
private string _connstring = "data source=(local);initial catalog=Northwind;uid=csharp;pwd=c#.net2004;";
private SqlConnection _conn;
///构造函数
public DataAccess()
{
_conn = new SqlConnection(_connstring);
Ҷƪл˵?
ASP.NET里的事务处理[05-20]
ASP.NET中使用Caching[05-20]
通过ASP.NET远程杀死进程[05-20]
Asp.net中DataGrid控件的自定义分..[05-20]
使用ASP.NET中调用WebService时不..[05-20]
利用ASP.NET实现域名查询[05-20]
用Asp.net实现简单的文字水印[05-20]
ASP.NET:Email Web Page[05-20]
ASP.NET 页面对象模型[05-20]
Asp.net 中服务端控件事件是如何..[05-20]
ASP.NET里的事务处理[05-20]
ASP.NET中使用Caching[05-20]
一个文件上传的类[05-20]
继承System.Web.UI.Page的页面基..[05-20]
静态方法和静态构造方法[05-20]
高效的Esmtp,带验证,用Socket编..[05-20]
用C#与XML创建动态分层菜单[05-20]
透明FLASH[05-20]
JS类:实现对联式广告[05-20]
网页间非常规方法传递值的方法[05-20]