Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Non-existent datagrid?

Reply
Thread Tools

Non-existent datagrid?

 
 
Paul W
Guest
Posts: n/a
 
      11-10-2004
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

SqlDataAdapter1.Fill(DataSet11)

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)

Thanks, Paul.


 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      11-10-2004
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.

hth

--

Scott Mitchell
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.4GuysFromRolla.com
http://www.ASPMessageboard.com
http://www.ASPFAQs.com

* When you think ASP, think 4GuysFromRolla.com!
 
Reply With Quote
 
 
 
 
Paul W
Guest
Posts: n/a
 
      11-10-2004
Hi - do you mean you prefer to declare everything in code? Can you give me
some reasons (security, etc.)?

Thanks

Paul.

"Scott Mitchell [MVP]" <(E-Mail Removed)> wrote in message
news:zGtkd.7068$(E-Mail Removed) ...
> 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.
>
> hth
>
> --
>
> Scott Mitchell
> (E-Mail Removed)
> http://www.4GuysFromRolla.com
> http://www.ASPMessageboard.com
> http://www.ASPFAQs.com
>
> * When you think ASP, think 4GuysFromRolla.com!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments