PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: Please help with dataset Select syntax
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: Please help with dataset Select syntax
![]() |
Re: Please help with dataset Select syntax |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
STom,
Hopefully my earlier response answered this. Yes, you can bind an array of datarows to a grid. Kathleen "STom" <stombiztalker@hotmail.com> wrote in message news:eEoTMbLPDHA.704@tk2msftngp13.phx.gbl... I am pulling my hair out over this, I know it can't be this difficult. Here is my code: Dim lConn As SqlConnection Dim da As New SqlDataAdapter Dim ds As New DataSet Dim dar As DataRow() lConn = New SqlConnection("Data Source=(local);Initial Catalog=pubs;User Id=sa;Password=;") Const strSQL As String = "Select * From Employee" Dim myCommand As New SqlCommand(strSQL, lConn) da.SelectCommand = New SqlCommand(strSQL, lConn) da.Fill(ds) dar = ds.Tables(0).Select("ORDER BY fname DESC") DataGrid1.DataSource = dar DataGrid1.DataBind() When I run this, on the like where I fill the datarow array I get an error that says: Missing operand after 'BY' operator. If I remove the ORDER BY and run it (thinking it might not need to ORDER BY to understand what it needs to do), I get an error that says: Missing operand after 'DESC' operator. What the heck is this thing looking for? Can you even bind a datarow array to a grid? Thanks. STom |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

