Why oh why doesn't my data view work?

Discussion in 'ASP .Net' started by David Prowak, Jan 30, 2004.

  1. David Prowak

    David Prowak Guest

    Hi,

    Anyone see a problem with this code? On initial page load, the datagrid
    displays properly. The datagrid doesn't display any recs via the code below.
    (Note - I've hardcoded the sort property just to see if I could get it to
    work. Yes, I do have a column intSBL. Yet, it doesn't work...)

    sqlConnection2.Open();
    sqlDataAdapter1.Fill(dataSet11, "tblParcels");
    sqlConnection2.Close();

    DataView dv = dataSet11.Tables["tblParcels"].DefaultView;
    dv.Sort = "intSBL ASC";

    DataGrid1.DataSource = dv;
    DataGrid1.DataBind();

    TIA,
    Dave
     
    David Prowak, Jan 30, 2004
    #1
    1. Advertising

  2. what happens if you use the dataset and comment out the sorting?
    DataGrid1.DataSource = dataSet11;
    DataGrid1.DataBind();

    the code looks correct to me. one more thing, you do have data in your
    dataset right? that is ds.tables[0].rows.count > 0????

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "David Prowak" <> wrote in message
    news:%...
    > Hi,
    >
    > Anyone see a problem with this code? On initial page load, the datagrid
    > displays properly. The datagrid doesn't display any recs via the code

    below.
    > (Note - I've hardcoded the sort property just to see if I could get it to
    > work. Yes, I do have a column intSBL. Yet, it doesn't work...)
    >
    > sqlConnection2.Open();
    > sqlDataAdapter1.Fill(dataSet11, "tblParcels");
    > sqlConnection2.Close();
    >
    > DataView dv = dataSet11.Tables["tblParcels"].DefaultView;
    > dv.Sort = "intSBL ASC";
    >
    > DataGrid1.DataSource = dv;
    > DataGrid1.DataBind();
    >
    > TIA,
    > Dave
    >
    >
    >
    >
     
    Alvin Bruney [MVP], Jan 30, 2004
    #2
    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. =?Utf-8?B?VHJveQ==?=

    Why doesn't posting data from a User Control work?

    =?Utf-8?B?VHJveQ==?=, Jan 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    360
    Victor Garcia Aprea [MVP]
    Jan 24, 2004
  2. dw
    Replies:
    1
    Views:
    420
    Mohamed El Ashmawy
    Sep 14, 2004
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,216
    Smokey Grindel
    Dec 2, 2006
  4. RichB
    Replies:
    7
    Views:
    5,921
    dkmorris1999
    Sep 21, 2009
  5. Parthiv Joshi
    Replies:
    1
    Views:
    804
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page