winform datagridview多线程出现红叉解决方案 http://pan.baidu.com/s/1ntimMgx
winformdatagridview多线程出现红叉解决方案http://pan.baidu.com/s/1ntimMgx...
winform datagridview多线程出现红叉解决方案 http://pan.baidu.com/s/1ntimMgx
展开
1个回答
2015-07-23
展开全部
代码如下:
C# code?
using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=MasterDB;Persist Security Info=True;User ID=sa"))
{
SqlDataAdapter da = new SqlDataAdapter("select * from GoodsMain", con);
DataSet ds = new DataSet();
da.Fill(ds);
this.dataGridView1.DataSource = ds;
this.dataGridView1.DataMember = ds.Tables[0].TableName;
}
C# code?
using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=MasterDB;Persist Security Info=True;User ID=sa"))
{
SqlDataAdapter da = new SqlDataAdapter("select * from GoodsMain", con);
DataSet ds = new DataSet();
da.Fill(ds);
this.dataGridView1.DataSource = ds;
this.dataGridView1.DataMember = ds.Tables[0].TableName;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询