Skip to content

.net

anil john

Asked Aug 27, 2012, 3:36 AM EDT1 answer
Share
LinkedInX
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;

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 1 short reply
    • 0
      check   con.conSql; value
      0