ARACK04
asked on
parameterized queries
Is it ok to set the parameters of an SqlCommand before they appear in the command text? ie,
myCommand.Parameters.add(" @value", myInt);
myCommand.CommandText = "SELECT * FROM table WHERE val=@value";
somereader = myComand.ExecuteReader();
It's a long story why I'm asking....would this throw an exception?
myCommand.Parameters.add("
myCommand.CommandText = "SELECT * FROM table WHERE val=@value";
somereader = myComand.ExecuteReader();
It's a long story why I'm asking....would this throw an exception?
Yes it is ok
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.