On a brand new aspx page I dragged a table from my local SQLServer in the
'Server Explorer' and it created the SqlConnection1 and SqlDataAdapter1. I
then used 'Generate Dataset' to create a simple dataset.
I created a datagrid and set its DataSource to 'DataSet11' and its
DataMember to 'TblEvents' (the name of the table). In the page designer it
correctly shows the column names from this table.
In the Page_Load I have
which matches the names of my objects. When I run this I see (from a SQL
trace) that it is querying the db, however, the page is blank and when I
look at the html source its basically 'empty'.
Yes, there is data in the table, and I can even see this data from within
the Server Explorer.
Any ideas what might be the problem? I've repeated this a few times, and
still can't get it to work (same with other data-bound controls)
Scott Mitchell [MVP]
Paul, I am not a big fan of this technique, and therefore only have
limited experience with it, but IIRC you need to do a Page.DataBind()
call after the SqlDataAdapter1.Fill(...) line.