0
SqlCommand cmd = new SqlCommand("FlowClientHardQ 0, 10, 1, 1, 364, Null", conn);

works with no error

SqlCommand cmd = new SqlCommand("FlowClientHardQ @ID_User, @ID_ListGroupParIzm, 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"

2
  • what is user. Is it an id of the user or a user object. Commented Jan 28, 2010 at 6:36
  • its id , but problem is solved , except I have no idea how to send NULL value Commented Jan 28, 2010 at 7:05

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Need to set CommandType to be StoredProcedure?

1 Comment

StoredProcedure, you helped me to wrote it ^_^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.