Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Why oh why doesn't my data view work?

Reply
Thread Tools

Why oh why doesn't my data view work?

 
 
David Prowak
Guest
Posts: n/a
 
      01-30-2004
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




 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      01-30-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>



 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET MVC - Add View: View Data Class RichB ASP .Net 7 09-21-2009 10:02 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
How to make a week view and day view calendar just like month view calendar in .NET ? Parthiv Joshi ASP .Net Web Controls 1 07-06-2004 03:15 PM
Wierd error when going to Design View from HTML view VB Programmer ASP .Net 1 07-10-2003 03:20 PM



Advertisments