Why oh why doesn't my data view work?

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
 
A

Alvin Bruney [MVP]

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top