DataTable.Select - System.Data.SyntaxErrorException

  • Thread starter Thread starter avnrao
  • Start date Start date
A

avnrao

Hi there,

I am getting an error when i try this code.

DataRow[] childRows = dsQueryPlan.Tables[0].Select("Parent = 1");



the error is :



System.Data.SyntaxErrorException

Syntax error in Lookup expression: Expecting keyword 'Parent' followed by a
single column argument with possible relation qualifier:
Parent[(<relation_name>)].<column_name>."


dsQueryPlan is the dataset. I have a table which has column Parent in it.
If i try with any other column, it works. It doesnt work with this column
alone.

any ideas??
ty.
 
avnrao said:
I am getting an error when i try this code.

DataRow[] childRows = dsQueryPlan.Tables[0].Select("Parent = 1");

the error is :

System.Data.SyntaxErrorException

Syntax error in Lookup expression: Expecting keyword 'Parent' followed by a
single column argument with possible relation qualifier:
Parent[(<relation_name>)].<column_name>."

dsQueryPlan is the dataset. I have a table which has column Parent in it.
If i try with any other column, it works. It doesnt work with this column
alone.

(In future, ADO.NET questions are better asked in the
microsoft.public.dotnet.framework.adonet newsgroup, btw.)

Parent is a reserved word, because it's used for relationships.

I suggest you try [Parent] instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top