I am getting an error: Fill: SelectCommand.Connection property has not been initialized., whats wrong in my code
my code:
sda = new SqlDataAdapter();
cmd = new SqlCommand();
cmd.Connection = con.conSql;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_SelectFormName";
DataTable dt = new DataTable();
sda.SelectCommand = cmd;
sda.Fill(dt);
dgPreveleges.DataSource = dt;
.net
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
1 short reply
raghunathas2 pointsPosted Aug 27, 2012, 3:45 AM EDT