load the webgrid from the backend manually coded

4 replies. Last post: September 29, 2009 4:08 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
caMember

hi,


i am trying to load the webgrid onthe page load even by the following code OleDbCommand Cmd1 = Connection1.CreateCommand();

        Cmd1.CommandType = CommandType.Text;
        Cmd1.CommandText = query;
        Cmd1.Connection.Open();
        OleDbDataAdapter da1 = new OleDbDataAdapter(Cmd1);
        OleDbCommandBuilder comBuilder1 = new OleDbCommandBuilder(da1);
        DataTable dt1 = new DataTable();
        da1.Fill(dt1);
        WebGrid1.DataSource = dt1;
        WebGrid1.DataBind();
        Cmd1.Connection.Close();

 

But i am getting a webgrid with empty data.  In the bottom of the grid it shows the loaded number exactly.


please help me to solve


thanks and regards

ca

All times are GMT -5. The time now is 9:22 PM.
Previous Next