vijay kumar

vijay kumar

  • NA
  • 22
  • 19k

Datagrid

Mar 25 2014 5:43 AM
 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)