SQL parsing error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Microsoft SQL Server Compact Edition V 3.5

When I send this SELECT string:

SELECT Shape_ID FRADDL FRADDR TOADDL TOADDR FROM roads_WI

in this code fragment:

using(SqlCeDataAdapter scda = new SqlCeDataAdapter(sqlQuery, conn)) {
using(DataSet ds = new DataSet()) {
int count = scda.Fill(ds);


I always get this error message during the Fill:

There was an error parsing the query. [ Token line number = 1,Token line
offset = 24,Token in error = FRADDR ]

The stack trace is:

at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior
behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
[then my code as above]

When I change around the column names, I get an error at the same offset but
with the new name showing. For example, if I drop FRADDL from the query
string the error is reported as:

There was an error parsing the query. [ Token line number = 1,Token line
offset = 24,Token in error = TOADDL ]

Any ideas?

Thanks in advance.
.



Relevant Pages

  • Re: Dataset retunring Null ..a gurus opinion required!
    ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String srcTable, ... IDbCommand command, CommandBehavior behavior) ... I initialised the adapter by doing this: ... toolbox to the design area to establish the connection. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Data access error
    ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... srcTable, IDbCommand command, CommandBehavior behavior) ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Issue with importing CSV file using JET. Error Message: Cannot update. Database or object is read&#
    ... Database or object is read-only.' ... public DataTable getCSVtable(string inFile, string header) ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Data access error
    ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ... on this server that access the same database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP Syntax using Variable for DropDownList1 as criteria in Pervasive SQL query
    ... <SelectParameters> ... behavior, String method, Boolean needReader, ObjectmethodArguments, ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.framework.aspnet)