setting up for calling a stored procedure

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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();
 
Back
Top