Problem solve Get help with specific problems with your technologies, process and projects.

Best approach for using stored SQL procedures in Visual C++

Greg Low outlines six steps for using stored SQL procedures in Visual C++.

I want to use stored SQL procedures in visual C++. Specifically, my stored procedure is a query which takes three parameters as input. What is the best approach for making this work?
In any language that can use the ADO.NET library, you simply follow these steps:

1. Create a SQLCommand object 2. Set the CommandType to CommandType.StoredProcedure 3. Set the CommandText to the...

name of the procedure 4. Create 3 x SQLParameter objects, setting their type, name and values 5. Add the SQLParameter objects to the SQLCommand's Parameters collection 6. Call the ExecuteNonQuery method of the SQLCommand object

This was last published in December 2005

Dig Deeper on SQL Server Stored Procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.