6
Answers

Datagrid

vijay kumar

vijay kumar

10y
1.5k
1
 SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=StudentRegistration;Integrated Security=True");
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from StudentInfo",con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
             DataSet ds = new DataSet();
             da.Fill(ds);
             dataGridView1.DataSource = ds;
             dataGridView1.DataMember = "Student";
why i am getting Object reference not set to an instance of an object in this the code is correct i think.


pls reply guys
Answers (6)