Um..it is hard to tell because of the formatting of the post..
Here goes..
1) When using dynamic Sql ..it is a good thing to Response.Write the Query
to make sure it is getting all the values required to run successfully..
2) It also gives an indication of any formatting errors in the query ie:
missing commas, spaces ect.
It could be the formating in the post but you could be missing some
spaces...
A "" may not provide the space provided by " ".
Failing that check your value parameters.
Also you haven't specified a rdbms which is usually helpful when dealing
with sql problems.
I am assuming SQL Server..
Cheers,
Adam
Ps: So where are you from?
"Pat" <na********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I'm trying to do a sorting in a Datagrid below but i'm getting
ERRROR:- "Line 1: Incorrect syntax near 'CompanyID'."
strQuery = "Select InvoiceDate,OrderDate From CMRC_Orders ORDER BY " & _
viewstate("sortField").ToString & "" & _
viewstate("sortdirection") & "" & _
"where CompanyID = " & myDropDownList.SelectedItem.Value
Any ideas 'm passing the DropDwon Selected value because thats what i use
to
populate the Datagrid