Hello people of Visual C++.
I have the following error:
.\mapa-semanal.cpp(9) : error C2039: 'Data' : is not a member of 'System'
what's causing this error?
thank you for your atention.
// mapa-semanal.cpp : Defines the entry point for the console application.
//
#include
"stdafx.h"#using
<mscorlib.dll>using
namespace System;using
namespace System::Data;using
namespace System::Data::OleDb;int
_tmain(int argc, _TCHAR* argv[]){
//Create the connectionOleDbConnection * map =
new OleDbConnection();//Set the connection stringmap->ConnectionString =
S
" Provider=Microsoft.Jet.OLEDB.4.0; "S
"Data Source=C:\\db\\mapasemana.mdb"//Try open databasetry{
//Open databasemap->Open();
Console::WriteLine(S
"Connected to database successfully!");}
catch (OleDbExeption * pe){
Console::Write(S
"Error occurred: ");Console::WriteLine(pe->Message);
}
//Close the connectionif (map->State != ConnectionState::Closed){
map->Close();
}
Console::WriteLine(S
"The database connection is now closed");return 0;}