问题描述
SqlConnectionconn3=newSqlConnection();conn3.ConnectionString="DataSource=(local);InitialCatalog=StcDB;IntegratedSecurity=True;";conn3.Open();SqlDataAdapterdata3=newSqlDataAdapter();BindingSourcebs=newBindingSource();//声明绑定类data3.SelectCommand=newSqlCommand();data3.SelectCommand.CommandText="select*fromcomUserPosition";data3.SelectCommand.CommandType=CommandType.Text;data3.SelectCommand.Connection=conn3;DataSetdataSet2=newDataSet();data3.Fill(dataSet2,"Test");bs.DataSource=dataSet2;bs.DataMember="Test";bindingNavigator1.BindingSource=bs;tableDataGridView.DataSource=bs.DataSource;
时间: 2024-09-18 03:51:42