Click here to Skip to main content
11,580,926 members (64,435 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hello There
i am new to this but i am doing a project about getting data off a table
the project will search a string of a table as well as search of a combo boxes
now for now am trying to add an sql quiry
the quiry bis the following

SELECT Number_Plate, Regstered_Keeper, Make, Model, Year_Of_Make, Colour, Engine_Size, Transmission, Fuel_Type
FROM `tabledata.csv`
WHERE Number_Plate =@plate

i am getting an error with the local variable
it is giving me the following error:

ERROR in WHERE Closure near '@'
unable to purse query text


any help is apreciated
Posted 3-Jan-13 14:13pm
m4j254

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This query won't work unless you also give it a value for @plate. Are you doing that ? Also, you don't use quotes in SQL. Nor do you use SQL to parse a local file in the file system, I assume tabledata.csv is a local CSV and not a table in your DB ? What you're doing looks like it's broken beyond repair. You need to write non SQL code to parse a CSV, or SQL code to look inside the database.
  Permalink  
Comments
m4j at 4-Jan-13 5:54am
   
Do you mean diclare it in SQL or visual studio?
the tabl has to be there as a csv file.. i have a database with the detils but unfortunatly itwas done in MySQL which is not supported by the Visual Studio
although, ifi put a number plate that is specific in the SQL code, i am able to disply all th dtails of that but the variable is still an issue... Sorry for taking your time and your help is very apreciated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Frankie-C 195
1 OriginalGriff 184
2 F-ES Sitecore 80
3 Andy Lanng 75
4 Afzaal Ahmad Zeeshan 75
0 OriginalGriff 1,108
1 Sergey Alexandrovich Kryukov 785
2 Abhinav S 622
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100