PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Re: Binding a datarow array to a grid

Reply

Re: Binding a datarow array to a grid

 
Thread Tools Rate Thread
Old 29-06-2003, 04:44 AM   #1
Kathleen Dollard
Guest
 
Posts: n/a
Default Re: Binding a datarow array to a grid


STom,

The order by expression you are passing is being treated as a filter
expression and naturally fails.

The syntax for the Select overload you want is

Overloads Public Function Select( _
ByVal filterExpression As String, _
ByVal sort As String _
) As DataRow()

So try

dar = ds.Tables(0).Select(FilterExpression,"QUEUE_TIME DESC")

If it won't take Nothing for the filter expression, try "1=1"

Kathleen


"STom" <stombiztalker@hotmail.com> wrote in message
news:OaTzwxDPDHA.2160@TK2MSFTNGP11.phx.gbl...
I get back an DataSet and what I want to do is order the records in the
dataset in a descending order. My code looks like this:

Dim dar As DataRow()
dar = ds.Tables(0).Select("ORDER BY QUEUE_TIME DESC")
Me.grdDetail.DataSource = dar
Me.grdDetail.DataBind()

When I execute this it tells me that I have a problem AFTER the BY. My
column name in the dataset is 'QUEUE_TIME' so I'm not sure what the problem
is here.

Also, will binding the datarow array to the grid work without giving errors?
It seems like I remember trying to bind a datarow array to a listbox before
but it would just keep throwing exceptions saying that an object does not
exist.

Thanks for any help.

STom




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off