您的位置:首页 > 其它

将查询结果注入到DataSet中使用哪个方法?

2006-03-14 14:51 316 查看
何?何が したいですか?(懂日语的达人告诉偶“让我”怎么加啊)

按自己的理解随便写点东西:

连接SQL时,可以这么用(小p孩就是小p孩,只懂这么多)

string strCon = "server=localhost;uid=sa;pwd=;database=Northwind" ;

string strCom = "SELECT * FROM Products" ;

SqlDataAdapter daGetProducts = New SqlDataAdapter(strCom, strCon);

DataSet dsProducts = new DataSet();

daGetProducts.fill(dsProducts,"Products");

DataGrid1.DataSource = dsProducts.Tables("Products") ;//写入到DataGrid1中
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐