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

                               while (rdr.Read())

                               {

                                      // get the results of each column

                                      string contact = (string)rdr["ContactName"];

                                      string company = (string)rdr["CompanyName"];

                                      string city    = (string)rdr["City"];

 

                                      // print out the results

                                      Console.Write("{0,-25}", contact);

                                      Console.Write("{0,-20}", city);

                                      Console.Write("{0,-25}", company);

 << 上一页  [11] [12] [13] [14]  下一页

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