anil john

anil john

  • NA
  • 147
  • 172.7k

.net

Aug 27 2012 7:36 AM
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;


Answers (1)