zoukankan      html  css  js  c++  java
  • DataSet数据筛选和排序

    Code

    //先创建数据适配器,

    SqlDataAdapter da=new SqlDataAdapter();

    da.SelectCommand=new SqlCommand(sql,conn);

    //创建和填充数据集

    DataSet ds=new DataSet();

    da.Fill(ds,"Customers");

    //每个查询返回一个数据集,每个结果都保存在单独的DataTable中.第一个显示地命名Customers,第二个表达默认名词为Customers1.

    //从数据集的Tables属性获得DataTables对象集合

    DataTableCollection dtc=ds.Tables;

     在显示第一个表时:

    string fl="country='Germany'";//sql where

    string srt="CompanyName desc";//sql desc

  • 相关阅读:
    Adobe Photoshop CC 2017-18.0安装教程
    Adobe After Effects 2017-14.0安装教程
    Qt之新手打包发布程序
    Qt之添加图标
    突然好想你
    设计模式—桥接
    设计模式—适配器
    设计模式—原型(附带介绍浅拷贝和深拷贝)
    设计模式—抽象工厂
    框架设计——MVC IOC
  • 原文地址:https://www.cnblogs.com/binlyzhuo/p/1338657.html
Copyright © 2011-2022 走看看