I am new to C #, but I know SQL well. I have a query that works fine in the SQL editor, but I cannot integrate it into my code. This eliminates incorrect SQL Exception syntax. The original SQL query that works fine:
select an excellent description from table_A, where id = '001', from the description;
A C # line would look like this:
_cmd.CommandText = "select distinct description from Table_A where Plant_ID =" + _selectedPlantID + "order by description";
The above query works in a C # program when I delete a part + "order by description. Here _selectedPlantIDis the only variable that gets the value in the program. I am pretty sure there should be some kind of problem with quotes, but for me everything looks great, so I was wondering if there is any other way to write this in C #?
source
share