c# - Basic SQL - SELECT -


Then I got this code:

  query2 = "SELECT *" WHERE id = '"+ ID +"' ";  

And it seems that there may be problems with the script, maybe I'm doing something wrong here. For example, when I write it:

  query2 = "SELECT * to click WHERE id = 3";  

.. It works just fine, and the script is not a problem but with my original code it shows me this error:

OleDbException Was rejected by the user code

A type of exception occurred in the 'System.Data.OleDb.OleDbException' system

Itemprop = "text">

The way you have typed the query will be like this :

  SELECT * by clicking on WHERE ID = '3'  

come of a number Pass' which means that it looks the same as the ID as a string 3. So you want to delete a single quote around the number, so it will search for the number 3, or whatever number you use, this is what you want:

  query2 = Clicking SELECT * WHERE ID = "+ ID;