打印本文 打印本文 关闭窗口 关闭窗口
第五课 使用断开数据--DataSet和SqlDataAdapter(翻译)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数15901  更新时间:2007/11/14 13:12:43  文章录入:mintao  责任编辑:mintao
        // set up ADO.NET objects

        public void InitData()

        {

               // instantiate the connection

               conn = new SqlConnection(
                       "Server=(local);DataBase=Northwind;Integrated Security=SSPI");

              

               // 1. instantiate a new DataSet

               dsCustomers = new DataSet();

 

               // 2. init SqlDataAdapter with select command and connection

               daCustomers = new SqlDataAdapter(
                       "select CustomerID, CompanyName from Customers", conn);

 

               // 3. fill in insert, update, and delete commands

               SqlCommandBuilder cmdBldr = new

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18]  下一页

打印本文 打印本文 关闭窗口 关闭窗口