A
Alex
Hi, is it better or more efficient or somehow "different" to make an ad hoc
query using the Parameters collection of a Command object, than constructing
a sql string for the CommandText property?
Example:
//assumes a LastName parameter
str Cmd = "SELECT FirstName FROM Employees WHERE (LastName = @LastName)"
//vs
//assumes a aString with a value
str Cmd = "SELECT FirstName FROM Employees WHERE LastName = ' " +aString+
" ' " ;
query using the Parameters collection of a Command object, than constructing
a sql string for the CommandText property?
Example:
//assumes a LastName parameter
str Cmd = "SELECT FirstName FROM Employees WHERE (LastName = @LastName)"
//vs
//assumes a aString with a value
str Cmd = "SELECT FirstName FROM Employees WHERE LastName = ' " +aString+
" ' " ;