Skip to content Skip to sidebar Skip to footer

There Was An Error Parsing The Query Sql Server Ce / Vs 2010 Local Database

I wrote an little app in C# to keep track of customers and jobs but I get an error 'There was an error parsing the query.[Token line number = 1, Token line offset = 38,Token in

Solution 1:

You have used a '?' where you needed a '@ for the Name parameter:

  cmd.CommandText = "SELECT * FROM FarmJobs WHERE Name = @Name"; 
  cmd.Parameters.AddWithValue("@Name", myName);   

[Side note: I would recommend using an explicit column list rather than SELECT * ]

Post a Comment for "There Was An Error Parsing The Query Sql Server Ce / Vs 2010 Local Database"