473,378 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

validate sql syntax

How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is changed in the database, but i'm working with other
statements as well, and need to just verify that the syntax of the string is correct, and determine if it is a select, update,
insert or delete statement.

I've looked but can't seem to find a class that does this.


Nov 18 '05 #1
6 4325
do you use a single method for all types of query?

"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is changed in the database, but i'm working with other statements as well, and need to just verify that the syntax of the string is correct, and determine if it is a select, update, insert or delete statement.

I've looked but can't seem to find a class that does this.

Nov 18 '05 #2
do you use a single method for all types of query?

"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is changed in the database, but i'm working with other statements as well, and need to just verify that the syntax of the string is correct, and determine if it is a select, update, insert or delete statement.

I've looked but can't seem to find a class that does this.

Nov 18 '05 #3

"Sharon" <ta*******@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
do you use a single method for all types of query?

?!?!
I am asking if there exists a method to do this.


"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is

changed in the database, but i'm working with other
statements as well, and need to just verify that the syntax of the string

is correct, and determine if it is a select, update,
insert or delete statement.

I've looked but can't seem to find a class that does this.


Nov 18 '05 #4

"Sharon" <ta*******@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
do you use a single method for all types of query?

?!?!
I am asking if there exists a method to do this.


"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is

changed in the database, but i'm working with other
statements as well, and need to just verify that the syntax of the string

is correct, and determine if it is a select, update,
insert or delete statement.

I've looked but can't seem to find a class that does this.


Nov 18 '05 #5
it is not clear from what you wrote, whether you are using
a single method for all types of data access,
or that you are trying to validate a query for a specific type of data
access
in a specific method.
usually different methods are used for different types of data access.
you don't even have to implement it.
check out Data Access Application Block for .NET:
http://msdn.microsoft.com/library/de...ml/daab-rm.asp
"Jarod_24" <ja******@hotmail.com> wrote in message
news:62******************************@news.teranew s.com...

"Sharon" <ta*******@hotmail.com> wrote in message

news:%2****************@TK2MSFTNGP11.phx.gbl...
do you use a single method for all types of query?

?!?!
I am asking if there exists a method to do this.


"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is

changed in the database, but i'm working with other
statements as well, and need to just verify that the syntax of the
string is correct, and determine if it is a select, update,
insert or delete statement.

I've looked but can't seem to find a class that does this.



Nov 18 '05 #6
it is not clear from what you wrote, whether you are using
a single method for all types of data access,
or that you are trying to validate a query for a specific type of data
access
in a specific method.
usually different methods are used for different types of data access.
you don't even have to implement it.
check out Data Access Application Block for .NET:
http://msdn.microsoft.com/library/de...ml/daab-rm.asp
"Jarod_24" <ja******@hotmail.com> wrote in message
news:62******************************@news.teranew s.com...

"Sharon" <ta*******@hotmail.com> wrote in message

news:%2****************@TK2MSFTNGP11.phx.gbl...
do you use a single method for all types of query?

?!?!
I am asking if there exists a method to do this.


"Jarod_24" <ja******@hotmail.com> wrote in message
news:97******************************@news.teranew s.com...
How do i check if a sql-string has corect syntax.

With select-statements you can just use a Datareader, since no data is

changed in the database, but i'm working with other
statements as well, and need to just verify that the syntax of the
string is correct, and determine if it is a select, update,
insert or delete statement.

I've looked but can't seem to find a class that does this.



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil Powell | last post by:
I am not sure why this is producing a SQL Server related error, but w/o having an instance of SQL Server on my machine to verify anything further, can you all help me with this? <!--- validate()...
25
by: bearophileHUGS | last post by:
This post comes from a boring morning, if you are busy ignore this. This post is only for relaxed people. I've found this page, "Syntax Across Languages", it contains many errors and omissions,...
5
by: WF | last post by:
Hello, I don't know if it is the right place for my question but I would like to know if ther's a way to validate a SQL request before sending it to the database. I was thinking abut using Regular...
3
by: Jarod_24 | last post by:
How do i check if a sql-string has corect syntax. With select-statements you can just use a Datareader, since no data is changed in the database, but i'm working with other statements as well,...
3
by: ciaran.mchale | last post by:
Hi folks, I downloaded the binary version of Xerces C++ 2.7.0 for Windows and am using it to help me get up to speed with XML and XML Schema. So please excuse me if this is a "novice" question....
1
by: Gaetan | last post by:
I have a web application where the user can type the name of a file name in a field. I want to make sure the syntax of that filename is valid before using it. I browsed the methods in various...
1
by: FightClubDiego | last post by:
Hey.. I've been working on these sign up / log in forms for my new Game Site, and everything else in the game works but the registration!! I keep ketting the unexpected $end and Im tired of it! Here...
37
by: miken32 | last post by:
In PHP, if a function returns an array it's fairly common to capture its return values like this: <?php list($foo, $bar, $baz) = some_function_that_return_an_array(); ?> In Javascript, would...
5
by: Adam Pelling | last post by:
I'm getting this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/neblncbt/public_html/forum/includes/acp/acp_board.php on line 69 Here is the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.