DataTable DataTable1 = WholesaleSelect.SelectDBManage();
this.dataGridView.DataSource = DataTable1;
其中WholesaleSelect的SelectDBManage方法:
SqlConnection SqlConnection1 =“”;
SqlConnection1.Open();
string CommandText = “”;
SqlCommand SqlCom= new SqlCommand(CommandText, SqlConnection1);
int intResult = SqlCom.ExecuteNonQuery();
if (intResult != 1)
{
throw new Exception("");
}