string strConnection = "Data Source=.;Initial Catalog=CustomerDB1;Persist Security Info=True;User ID=sa;Pooling=False";
SqlConnection objConnection = new SqlConnection(strConnection);
objConnection.Open();
string strCommand = "Select * From Customer";
SqlCommand objCommad = new SqlCommand(strCommand, objConnection);
DataSet objDataSet = new DataSet();
SqlDataAdapter objAdapter = new SqlDataAdapter(objCommad);
dtgCustomer.DataSource = objDataSet.Tables[0];
objConnection.Close();
错误
尝试了多种方法,