Page 1 of 1

VC2008 C++ managed, devart generates wrong code

Posted: Wed 18 Feb 2009 12:18
by jkanerva
ERROR 1 WITH DEVARD_postgres AND DEVART_MYSQL :

Postgres and MyDirect generates wrong code in C++ CLI .NET in Visual Studio 2008.

I am now using only postgres and it is mode importand now.

This is based on the simplest test having 2 rows in mySQL table with mySQLDataTable1 and only DataGrid display on a single Form1.
This code can not be compiled and an error occurs.
Every time I manually correct the code, system updates it back to false code.

Also IDE can not remove source code when graphical object from the Form is removed, but the carbage code remains in the source code and lots of it.

IDE ERROR FROM VISUAL STUDIO 2008 :
C2228: left of '.DataSetTable' must have class/struct/union
1> type is 'System::Data::Common::DataTableMapping ^'
1> did you intend to use '->' instead?

there should be object->object instead of xxx.xxx
EG:
this->mySqlDataTable1->TableMapping.DataSetTable = L"mySqlDataTable1"; // mySqlDataTable1->TableMapping->DataSetTable = L"mySqlDataTable1";

( This is the most complicated thing in C++/ managed (.NET). Who really understands these? Pointers and members. E=mc2 is easier ... )


GENERATED CODE BLOCK
// mySqlDataTable1
//
this->mySqlDataTable1->Columns->AddRange(gcnew cli::array(20) {this->mySqlDataTable1_PHONE,
this->mySqlDataTable1_ANNA, this->mySqlDataTable1_ANDERSSON, this->mySqlDataTable1_TS_STATUS, this->mySqlDataTable1_NOTE1, this->mySqlDataTable1_GSM,
this->mySqlDataTable1_TITLE, this->mySqlDataTable1_GROUP1, this->mySqlDataTable1_GROUP2, this->mySqlDataTable1_EMAIL, this->mySqlDataTable1_TS_ID,
this->mySqlDataTable1_ASSIST, this->mySqlDataTable1_ROOM, this->mySqlDataTable1_NOTE2, this->mySqlDataTable1_PHONE_PRIVAT, this->mySqlDataTable1_AUTO,
this->mySqlDataTable1_TIMESTAMP, this->mySqlDataTable1_TS_RET_TIME, this->mySqlDataTable1_SMS_PASSWORD, this->mySqlDataTable1_UPDATED});
this->mySqlDataTable1->Connection = this->mySqlConnection1;
cli::array^ __mcTemp__1 = gcnew cli::array(6) {L"PHONE", L"ANNA", L"ANDERSSON", L"GSM", L"GROUP1", L"TS_ID"};
this->mySqlDataTable1->Constraints->AddRange(gcnew cli::array(1) {(gcnew System::Data::UniqueConstraint(L"Constraint1",
__mcTemp__1, true))});
this->mySqlDataTable1->DeleteCommand = this->mySqlDeleteCommand1;
this->mySqlDataTable1->InsertCommand = this->mySqlInsertCommand1;
this->mySqlDataTable1->Name = L"mySqlDataTable1";
this->mySqlDataTable1->PrimaryKey = gcnew cli::array(6) {this->mySqlDataTable1_PHONE, this->mySqlDataTable1_ANNA,
this->mySqlDataTable1_ANDERSSON, this->mySqlDataTable1_GSM, this->mySqlDataTable1_GROUP1, this->mySqlDataTable1_TS_ID};
this->mySqlDataTable1->SelectCommand = this->mySqlSelectCommand1;
this->mySqlDataTable1->TableName = L"mySqlDataTable1";
this->mySqlDataTable1->UpdateCommand = this->mySqlUpdateCommand1;
this->mySqlDataTable1->Owner = this;
this->mySqlDataTable1->TableMapping.DataSetTable = L"mySqlDataTable1"; // mySqlDataTable1->TableMapping.SourceTable = L"mySqlDataTable1";

Posted: Wed 18 Feb 2009 13:36
by Shalex
We have removed your post from http://devart.com/forums/viewtopic.php?t=14182 as duplicated. We will look into this issue and notify you about the results as soon as possible.

Posted: Wed 25 Feb 2009 12:11
by Shalex
Thank you for the report. We have reproduced the problem with mapping. I will post here when it is fixed. As a workaround, please use the PgSqlDataTable component without making TableMapping.

Posted: Thu 13 Jan 2011 14:53
by Shalex
The problem is fixed. Please try using the latest build of dotConnect for PostgreSQL (5.0.86).