As the title says, if I'm using SQL parameters, ie
SQLCommand cmd = new SQLCommand("select * from users where username = @user and password = @pass limit 1", Cxn);
cmd.Parameters.Add("@user", SqlDbType.VarChar):
cmd.Parameters.Add("@pass", SqlDbType.VarChar):
Can I just enter the parameters value as the direct entry from the input?
cmd.Parameters["@user"].value = txtBxUserName.text;
cmd.Parameters["@pass"].value = txtBxPassword.text;
That's what seems to be suggested whenver you look for anything to do with escaping string etc, the end answer is to just let the parameter binding do it. But will that protect against injection attacks and the like? Or do you still need to perform some server side validation?
Coming from a heavily orientated PHP background it goes against every fibre of my body to directly enter text into a query :p