Non-existent datagrid?

Discussion in 'ASP .Net' started by Paul W, Nov 10, 2004.

  1. Paul W

    Paul W Guest

    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.
     
    Paul W, Nov 10, 2004
    #1
    1. Advertising

  2. Scott Mitchell [MVP], Nov 10, 2004
    #2
    1. Advertising

  3. Paul W

    Paul W Guest

    Hi - do you mean you prefer to declare everything in code? Can you give me
    some reasons (security, etc.)?

    Thanks

    Paul.

    "Scott Mitchell [MVP]" <> wrote in message
    news:zGtkd.7068$...
    > 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.4GuysFromRolla.com
    > http://www.ASPMessageboard.com
    > http://www.ASPFAQs.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
     
    Paul W, Nov 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ElGordo
    Replies:
    2
    Views:
    6,160
    Ersin Gençtürk
    Apr 29, 2005
  2. Joel D. Kraft

    Non-existent page is not throwing 404 error

    Joel D. Kraft, May 24, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,489
    Joel D. Kraft
    May 25, 2005
  3. dkode
    Replies:
    4
    Views:
    783
    dkode
    Apr 12, 2006
  4. Greg Sandell
    Replies:
    2
    Views:
    507
    Dimitre Novatchev
    Oct 8, 2003
  5. Les Caudle
    Replies:
    1
    Views:
    349
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
Loading...

Share This Page