|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GetOleDbSchemaTable VS 2005 C++DataTable* GetTables(OleDbConnection* conn) { Object* restrictions[] = {0, 0, 0, S"TABLE"}; DataTable* schemaTable = conn->GetOleDbSchemaTable(OleDbSchemaGuid::Tables, restrictions); return schemaTable; }; How to make this in Visual Studio C++ 2005 ?? When I in VS 2005 write like : DataTable^ GetTables(OleDbConnection^ conn) { Object^ restrictions[] = {NULL, NULL, NULL, "TABLE"}; DataTable^ schemaTable = conn->GetOleDbSchemaTable(OleDbSchemaGuid::Tables, restrictions); return schemaTable; }; I receive error: error C2728: 'System::Object ^' : a native array cannot contain this managed type Did you mean 'array<System::Object ^>'? I write this like: DataTable^ GetTables(OleDbConnection^ conn) { array<String^>^ myArray; myArray = gcnew array<String^> {"0", "0", "0", "TABLE"}; DataTable^ schemaTable = conn->GetOleDbSchemaTable(OleDbSchemaGuid::Tables, myArray); return schemaTable; }; it does not work because myArray has to be type Obiect^. "at System.Data.OleDb.OleDbConnectionInternal.GetSchemaRowset(Guid schema, Object[] restrictions)" HELP !!! |
|||||||||||||||||||||||