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:
November 11, 2008 at 1:54 AM
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.
Post a Comment