mmalis你好,示例如下,但是如果你做的没有错的话应该是Framework没有安好,可以重新安装一下Framework。
using System.Data;
using System.Data.SqlClient;......
SQLConnection con=new SQLConnection("server=localhost;database=pubs;uid=sa;pwd=;");
SQLDataAdapter apt=new SQLDataAdapter("SELECT * FROM authors",con);
DataSet dst=new DataSet();apt.Fill(dst,"authors");
dataGrid1.DataSource=dst.Tables["authors"].DefaultView;
dataGrid1.DataBinding();
......
using System.Data;
using System.Data.SqlClient;......
SQLConnection con=new SQLConnection("server=localhost;database=pubs;uid=sa;pwd=;");
SQLDataAdapter apt=new SQLDataAdapter("SELECT * FROM authors",con);
DataSet dst=new DataSet();apt.Fill(dst,"authors");
dataGrid1.DataSource=dst.Tables["authors"].DefaultView;
dataGrid1.DataBinding();
......
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货