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;