Link to home
Start Free TrialLog in
Avatar of ARACK04
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?
Avatar of Tertioptus
Tertioptus

Yes it is ok
ASKER CERTIFIED SOLUTION
Avatar of Tertioptus
Tertioptus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial