P
Phil
Hei,
I'm currently trying to write a program in C# that will allow users to
parametrize their queries.
For instance, I have a query like this:
SELECT * FROM Customers Where Region = @Region AND Gender > @Gender
How can I extract the Parameters names without using String
manipulation (which is not perfect since sql statements can also
contain '@' in LIKE clauses for example)
I tried this way
Dim comm As New OleDbCommand(SqlStatement, myCon)
comm.Prepare()
MsgBox(comm.Parameters.Count.ToString())
comm.Dispose()
myCon.Close()
but this always return me 0 (zero)
Do you have any idea on how to solve this generic problem?
Regars
Philippe Graca
I'm currently trying to write a program in C# that will allow users to
parametrize their queries.
For instance, I have a query like this:
SELECT * FROM Customers Where Region = @Region AND Gender > @Gender
How can I extract the Parameters names without using String
manipulation (which is not perfect since sql statements can also
contain '@' in LIKE clauses for example)
I tried this way
Dim comm As New OleDbCommand(SqlStatement, myCon)
comm.Prepare()
MsgBox(comm.Parameters.Count.ToString())
comm.Dispose()
myCon.Close()
but this always return me 0 (zero)
Do you have any idea on how to solve this generic problem?
Regars
Philippe Graca