Microsoft recommends using the parameters collection at this link to help prevent SQL Injection.
I am using the following code snipet
Basically, I expect an exception to be raised when the value of @ZipCode is set to a string of length 5. But no error is raised?
Can any of you shed light on why this error isn't being raised?
Thanks
Tom
I am using the following code snipet
Code:
cmd.CommandText = "SELECT plazaName from Plaza WHERE zip=@ZipCode"; cmd.Parameters.Clear(); cmd.Parameters.Add("@ZipCode", SqlDbType.VarChar, 4); cmd.Parameters["@ZipCode"].Value = "45840";
Can any of you shed light on why this error isn't being raised?
Thanks
Tom
Comment