Why oh why doesn't my data view work?

  • Thread starter Thread starter David Prowak
  • Start date Start date
D

David Prowak

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
 
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????
 
Back
Top