• λ我爱Aspx >> Asp.Net >> ADO.NET中的多数据表操作之读取
  • ADO.NET中的多数据表操作之读取

  • :未知  Դ:internet  :2007-5-20 16:44:42  ؼ:.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 页面对象模型
    һƪASP.NET里的事务处理