Quantcast
Channel: error c2039
Viewing all articles
Browse latest Browse all 5

error c2039

$
0
0

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 connection

OleDbConnection * map =

new OleDbConnection();

//Set the connection string

map->ConnectionString =

S

" Provider=Microsoft.Jet.OLEDB.4.0; "

S

"Data Source=C:\\db\\mapasemana.mdb"

//Try open database

try

{

//Open database

map->Open();

Console::WriteLine(S

"Connected to database successfully!");

}

catch (OleDbExeption * pe)

{

Console::Write(S

"Error occurred: ");

Console::WriteLine(pe->Message);

}

//Close the connection

if (map->State != ConnectionState::Closed)

{

map->Close();

}

Console::WriteLine(S

"The database connection is now closed");

return 0;

}


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images