c# SQL 做一个查询按钮,将查询结果显示在另一个窗体的datagridview中 30
想请问怎么样将一个窗体的数据绑定传递到另一个窗体form1的button事件如下:stringconnectionString="server=GIJTFGUTWGMCB...
想请问怎么样将一个窗体的数据绑定传递到另一个窗体
form1的button事件如下:
string connectionString = "server=GIJTFGUTWGMCB6O.; database=ZC MUSIC; uid=sa; pwd=940329;";
SqlConnection mCon = new SqlConnection(connectionString);
SqlCommand cmd1 = new SqlCommand(sqlStr);
cmd1.Connection = mCon;
DataSet dr1 = new DataSet();
BindingSource bs = new BindingSource();
bs.DataSource = dr1.Tables;
IndiviSearch f2 = new IndiviSearch();
f2.dataGridViewSearch.DataSource = bs;
mCon.Close();
this.Close();
indiviSearch的load事件里该怎么写才能把form1的查询结果显示在indiviSearch的datagridview中啊? 展开
form1的button事件如下:
string connectionString = "server=GIJTFGUTWGMCB6O.; database=ZC MUSIC; uid=sa; pwd=940329;";
SqlConnection mCon = new SqlConnection(connectionString);
SqlCommand cmd1 = new SqlCommand(sqlStr);
cmd1.Connection = mCon;
DataSet dr1 = new DataSet();
BindingSource bs = new BindingSource();
bs.DataSource = dr1.Tables;
IndiviSearch f2 = new IndiviSearch();
f2.dataGridViewSearch.DataSource = bs;
mCon.Close();
this.Close();
indiviSearch的load事件里该怎么写才能把form1的查询结果显示在indiviSearch的datagridview中啊? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询