setting up for calling a stored procedure

G

Guest

Hi,
I am using vs .net 2005, .net frameworks v3.0, vc++ 2005, on vista
I am trying to write a c++ app to call a sql stored procedure.

the following code genrates an error trap and I don't know why:

String ^myConnectionString = "Initial Catalog=ncxSQL;Data
Source=ENVISION-MOD;Integrated Security=SSPI;";
SqlConnection ^myConnection;
myConnection->ConnectionString = myConnectionString;

Any words of wisdom?
 
G

Guest

I'm not an expert in C++, but it looks like you are trying to assign a
property to uninitialized object (myConnection).
Create an instance by invoking the contructor, and you should be fine.
As I said before, do not know C++ syntax, but in C# it would look like:
SqlConnection myConnection = new SqlConnection();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top