SQL ASP.NET [Sql Command error]
SqlCommand cmd = new SqlCommand("FlowClientHardQ 0, 10, 1, 1, 364, Null", conn);
works with no error
SqlCommand cmd = new SqlCommand("FlowClientHardQ @ID_User, @ID_List开发者_运维技巧GroupParIzm, 1, 1, @CIzmer, Null", conn);
cmd.Parameters.AddWithValue("@ID_User", user);
cmd.Parameters.AddWithValue("@ID_ListGroupParIzm", ID_ListGroupParIzm);
cmd.Parameters.AddWithValue("@CIzmer", izmer);
Incorrect syntax near the construction "FlowClientHardQ"
Just do this:
SqlCommand cmd = new SqlCommand("FlowClientHardQ", conn);
cmd.Parameters.AddWithValue("@ID_User", user);
cmd.Parameters.AddWithValue("@ID_ListGroupParIzm", ID_ListGroupParIzm);
cmd.Parameters.AddWithValue("@CIzmer", izmer);
If you're calling a stored procedure, just set the command text to be the stored procedure name, and add the parameters like you're doing. Set the command type to StoredProcedure before you execute it.
Need to set CommandType to be StoredProcedure?
精彩评论