Hello.
When I try to follow the instructions in this tutorial:
http://www.functionx.com/mysqlnet/vcnet/Lesson04.htmI allways get these errors:
**************************
**********
*****
AssemblyInfo.cpp
sqltest1.cpp
Form1.h(90) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
Form1.h(91) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
Form1.h(90) : error C3699: '*' : cannot use this indirection on type 'MySql::Data::MySqlClient:
:MySqlConn
ection'
compiler replacing '*' with '^' to continue parsing
Form1.h(90) : error C2750: 'MySql::Data::MySqlClient:
:MySqlConn
ection' : cannot use 'new' on the reference type; use 'gcnew' instead
Form1.h(90) : error C2440: 'initializing' : cannot convert from 'MySql::Data::MySqlClient:
:MySqlConn
ection *' to 'MySql::Data::MySqlClient:
:MySqlConn
ection ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
Form1.h(91) : error C3699: '*' : cannot use this indirection on type 'MySql::Data::MySqlClient:
:MySqlComm
and'
compiler replacing '*' with '^' to continue parsing
Form1.h(91) : error C2750: 'MySql::Data::MySqlClient:
:MySqlComm
and' : cannot use 'new' on the reference type; use 'gcnew' instead
Form1.h(91) : error C2440: 'initializing' : cannot convert from 'MySql::Data::MySqlClient:
:MySqlComm
and *' to 'MySql::Data::MySqlClient:
:MySqlComm
and ^'
**************************
****
where line 90 is the first one of this sequence:
MySqlConnection *conDatabase = new MySqlConnection(S"Data Source=localhost;Persist Security Info=yes");
MySqlCommand *cmdDatabase = new MySqlCommand(S"CREATE DATABASE CarRental1;", conDatabase);
conDatabase->Open();
cmdDatabase->ExecuteNonQue
ry();
conDatabase->Close();
So:
My questions:
I changed this to:
MySqlConnection ^conDatabase = gcnew MySqlConnection(L"Data Source=localhost;Persist Security Info=yes");
MySqlCommand ^cmdDatabase = gcnew MySqlCommand(L"CREATE DATABASE CarRental1;", conDatabase);
conDatabase->Open();
cmdDatabase->ExecuteNonQue
ry();
conDatabase->Close();
but just because the compiler told me to do so.
Is this OK ? (never worked with gcnew, and no experience with unicode)...
Thanks.
Start Free Trial