PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: Binding a datarow array to a grid
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: Binding a datarow array to a grid
![]() |
Re: Binding a datarow array to a grid |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

