DataGridView问题
private void button1_Click(object sender, EventArgs e){
string connectionstring = "Data Source=LQ;Initial Catalog=count;Integrated Security=True";
SqlConnection con = new SqlConnection(connectionstring);
SqlCommand sqlcom = new SqlCommand("sp_login", con); //sp_login存储过程
= CommandType.StoredProcedure;
sqlcom.Parameters.Add("@userId",SqlDbType.VarChar,8).Value=11;
sqlcom.Parameters.Add("userPassWord",SqlDbType.VarChar,8).Value=11;
con.Open();
SqlDataAdapter custDA = new SqlDataAdapter(sqlcom);
DataSet custDS = new DataSet();
custDA.Fill(custDS, "login");
datagridview1.DataSource = custDS;
con.Close();
}
为什么没有反映。这样不能在DataGridView1中显示我要查找的结果吗??//不可以应该怎么改。