Hi Developers,
The SelectCommand property has not been initialized before calling “Fill
My line of code as following
SqlConnection cn = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\MANTHAN\Documents\Visual Studio 2010\WebSites\sample\App_Data\Database.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand("SELECT * FROM stu1", cn);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
GridView1.DataSource = ds.Tables[0];
Anonymous User
19-Jun-2013