.NET Compact Framework 2.0 SP2, SQLCE 3.5

A

Arul Kumar

I am Developing an windows Mobile Application Using windows Mobile 6
Professional, .NET Compact Framework 2.0 SP2, and SQLCE 3.5 . I am Using
SqlCeDatareader for Selecting the Query and Displays in a Text Box .
Following is the Code

sSql = "SELECT * From TMOBIHUBCE"
cmdSKU = New SqlCeCommand(sSql, oNewConnection)
cmdSKU.CommandText = CommandType.Text
rdrReadSKU = cmdSKU.ExecuteReader()

But it Displays The Following Error in Execute Reader Statement.
--------------------------------------------------------------------------
There was an error Parsing the Query. [Token Line number = 1, Token Line
offset =1, Token in error = 1 ].

Request to help me in this Regards, Thank you very Much

Arul Kumar
 
P

Paul G. Tobey [eMVP]

I don't know if it's necessary, but I always put a semicolon at the end of
my select statements.

I think that the real problem is likely to be this line:
cmdSKU.CommandText = CommandType.Text

It seems that you are replacing the text that you gave the command when you
created it with something else. The content of that "something else",
CommandType.Text, must be an invalid SQL statement.

Paul T.

Arul Kumar said:
I am Developing an windows Mobile Application Using windows Mobile 6
Professional, .NET Compact Framework 2.0 SP2, and SQLCE 3.5 . I am Using
SqlCeDatareader for Selecting the Query and Displays in a Text Box .
Following is the Code

sSql = "SELECT * From TMOBIHUBCE"
cmdSKU = New SqlCeCommand(sSql, oNewConnection)
cmdSKU.CommandText = CommandType.Text
rdrReadSKU = cmdSKU.ExecuteReader()

But it Displays The Following Error in Execute Reader Statement.
--------------------------------------------------------------------------
There was an error Parsing the Query. [Token Line number = 1, Token Line
offset =1, Token in error = 1 ].

Request to help me in this Regards, Thank you very Much

Arul Kumar
 
T

Tim Layton

Based on the sample code my best guess is that you are replacing the
cmdSKU.CommandText with invalid data. You need to check your logic here and
make sure the SQL is also correct.
 

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

Top