Recommendable stuff...

Tuesday, March 25, 2008

Getting constraint columns from a SQL Command

Sorry i don't have the solution. Does anyone know what is a good and clean way to extract the columns specified in the WHERE clause in a SQL Command?
eg, SQL COmmand :

SELECT * FROM HELLOWORLD WHERE FNAME='JOHN' AND LNAME='DOE'


I want to be able to extract the texts 'FNAME' and 'LNAME'. Working with vb.net.

Ideas?

ppl said stuff:

What about using placeholders before the SQL is built? i.e.

SELECT WHERE @FirstPlace='John' AND @SecondPlace='Doe'

Then populate the parameters

objCommand.Parameters.Add(objParam1)

You'll then be able to access the parameters by name.

Alternatively, you could do some RegEx detection in your string.

Get the new version of Firefox!