Click here to Skip to main content
15,921,295 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: AVIFileOpen trouble Pin
R.A.V.E.20-Apr-07 10:58
R.A.V.E.20-Apr-07 10:58 
GeneralRe: AVIFileOpen trouble Pin
Mark Salsbery20-Apr-07 11:07
Mark Salsbery20-Apr-07 11:07 
AnswerRe: AVIFileOpen trouble Pin
R.A.V.E.21-Apr-07 8:41
R.A.V.E.21-Apr-07 8:41 
QuestionRe: AVIFileOpen trouble Pin
Mark Salsbery22-Apr-07 7:14
Mark Salsbery22-Apr-07 7:14 
AnswerRe: AVIFileOpen trouble Pin
R.A.V.E.23-Apr-07 3:05
R.A.V.E.23-Apr-07 3:05 
GeneralRe: AVIFileOpen trouble Pin
Mark Salsbery23-Apr-07 4:52
Mark Salsbery23-Apr-07 4:52 
Questionright way to implement a popup window Pin
Jim Crafton20-Apr-07 8:43
Jim Crafton20-Apr-07 8:43 
QuestionSqlConnection does't work with CString????? Pin
Romiks20-Apr-07 8:27
Romiks20-Apr-07 8:27 
Hi All,
I am newbie for .net. I have created the simple console application and trying to create connection to SQL database.
Here is my code for console app:

#include "stdafx.h"<br />
#include "vcclr.h"<br />
#include "atlstr.h"<br />
#using "mscorlib.dll"<br />
#using "System.dll"<br />
#using "System.Data.dll"<br />
<br />
using namespace System;<br />
using namespace System::Data;<br />
using namespace System::Data::SqlClient;<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
CString hello("Hello");<br />
gcroot m_SqlDbConnection = gcnew SqlConnection(gcnew String(hello)); <br />
return 0;<br />
}

I have the following exeption
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Format of the initialization string does not conform to specification starting at index 0.


on the string
gcroot m_SqlDbConnection = gcnew SqlConnection(gcnew String(hello));
Please help me to resolve the problem or point me to the article.

P.S. I found that CString defined as in the atlstr.h
typedef CStringT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CAtlString;<br />
typedef CAtlString CString; Maybe it helps. 

AnswerRe: SqlConnection does't work with CString????? Pin
Mark Salsbery20-Apr-07 9:19
Mark Salsbery20-Apr-07 9:19 
QuestionTrouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 8:14
@largeinsd20-Apr-07 8:14 
AnswerRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 8:25
Mark Salsbery20-Apr-07 8:25 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 8:40
@largeinsd20-Apr-07 8:40 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 9:01
Mark Salsbery20-Apr-07 9:01 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
@largeinsd20-Apr-07 9:55
@largeinsd20-Apr-07 9:55 
GeneralRe: Trouble linking to SQL DB in VC++ Pin
Mark Salsbery20-Apr-07 10:02
Mark Salsbery20-Apr-07 10:02 
Questionhoe design control for C#.net ? Pin
hamid_m20-Apr-07 8:04
hamid_m20-Apr-07 8:04 
QuestionProblems moving date and time control on MFC dialog [modified] Pin
Barry True20-Apr-07 7:19
Barry True20-Apr-07 7:19 
AnswerRe: Problems moving date and time control on MFC dialog Pin
Barry True26-Apr-07 11:41
Barry True26-Apr-07 11:41 
Questionhtml and C++ Pin
Tully200320-Apr-07 6:06
Tully200320-Apr-07 6:06 
QuestionAnybody done any Speex development? Pin
Heavenword120-Apr-07 5:28
Heavenword120-Apr-07 5:28 
QuestionUsing UI-Thread Pin
CDRAIN20-Apr-07 4:58
CDRAIN20-Apr-07 4:58 
Questionstrcpy - Doing something wrong ?? Pin
Programm3r20-Apr-07 4:12
Programm3r20-Apr-07 4:12 
AnswerRe: strcpy - Doing something wrong ?? Pin
Programm3r20-Apr-07 4:17
Programm3r20-Apr-07 4:17 
GeneralRe: strcpy - Doing something wrong ?? Pin
Mark Salsbery20-Apr-07 7:43
Mark Salsbery20-Apr-07 7:43 
AnswerRe: strcpy - Doing something wrong ?? Pin
Michael Dunn20-Apr-07 7:01
sitebuilderMichael Dunn20-Apr-07 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.