From: Janusz M <januszms.usunto.@usunto.interia.pl> - 2004-01-18 23:16:15
|
Hi, My test case Firebird 1.5RC8. FirebirdNETProvider1.5 RC2 Database test.fdb, /*************************************************************************** ***/ /**** Generated by IBExpert 2003.12.18 2004-01-19 00:05:32 ****/ /*************************************************************************** ***/ SET SQL DIALECT 3; SET NAMES WIN1250; CREATE DATABASE 'd:\test.fdb' USER 'SYSDBA' PASSWORD 'masterkey' PAGE_SIZE 1024 DEFAULT CHARACTER SET WIN1250; /*************************************************************************** ***/ /**** Tables ****/ /*************************************************************************** ***/ CREATE TABLE TABLE_TEST ( FIELD1 INTEGER NOT NULL, FIELD2 CHAR(10) ); /*************************************************************************** ***/ /**** Primary Keys ****/ /*************************************************************************** ***/ ALTER TABLE TABLE_TEST ADD CONSTRAINT PK_TABLE_TEST PRIMARY KEY (FIELD1); The simple form whitout any controls except FbConnection,FbCommand,FbDataAdpter,FbCommandBuilder. The code generated from Visual C++ Standard 2003 : #pragma once namespace fbTest { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace FirebirdSql::Data::Firebird; /// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public __gc class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); } protected: void Dispose(Boolean disposing) { if (disposing && components) { components->Dispose(); } __super::Dispose(disposing); } private: FirebirdSql::Data::Firebird::FbConnection * fbConnection1; private: FirebirdSql::Data::Firebird::FbCommand * fbCommand1; private: FirebirdSql::Data::Firebird::FbCommandBuilder * fbCommandBuilder1; private: FirebirdSql::Data::Firebird::FbDataAdapter * fbDataAdapter1; private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container * components; /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->fbConnection1 = new FirebirdSql::Data::Firebird::FbConnection(); this->fbCommand1 = new FirebirdSql::Data::Firebird::FbCommand(); this->fbCommandBuilder1 = new FirebirdSql::Data::Firebird::FbCommandBuilder(); this->fbDataAdapter1 = new FirebirdSql::Data::Firebird::FbDataAdapter(); // // fbConnection1 // this->fbConnection1->ConnectionString = S"User=SYSDBA;Password=masterkey;Database=d:\\test.fdb;DataSource=localhost; Port=305" S"0;Dialect=3;Charset=WIN1250;Role=;Connection lifetime=0;Connection timeout=15;Po" S"oling=False;Packet Size=8192"; // // fbCommand1 // this->fbCommand1->CommandText = S"select field1,field2 from table_test"; this->fbCommand1->Connection = this->fbConnection1; // // fbCommandBuilder1 // this->fbCommandBuilder1->DataAdapter = this->fbDataAdapter1; // // fbDataAdapter1 // this->fbDataAdapter1->SelectCommand = this->fbCommand1; System::Data::Common::DataTableMapping* __mcTemp__1[] = new System::Data::Common::DataTableMapping*[1]; __mcTemp__1[0] = new System::Data::Common::DataTableMapping(S"Table", S"Table", new System::Data::Common::DataColumnMapping * [0]); this->fbDataAdapter1->TableMappings->AddRange(__mcTemp__1); // // Form1 // this->AutoScaleBaseSize = System::Drawing::Size(5, 13); this->ClientSize = System::Drawing::Size(552, 254); this->Name = S"Form1"; this->Text = S"Form1"; } }; } regards Janusz Mars |