打印本文 打印本文 关闭窗口 关闭窗口
第四课 使用SqlDataReader读取数据(翻译)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数15050  更新时间:2007/11/14 13:12:43  文章录入:mintao  责任编辑:mintao
               public void SimpleRead()

               {

                       // declare the SqlDataReader, which is used in

                       // both the try block and the finally block

                       SqlDataReader rdr = null;

 

                       // create a connection object

                       SqlConnection conn = new SqlConnection(

"Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");

 

                       // create a command object

                       SqlCommand cmd  = new SqlCommand(

                               "select * from Customers", conn);

 

                      

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 

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