C # to process data to DataWindow.net components
DataWindow.net is a data access component developed for MS.NET for PB.
Installation
Install .NET2003, Frame Release 1.1, then install the DataWindow.net component and design compilation environments.
The Sybase DataWindow control tab appears when the .NET2003 form is designed.
2. Use
The DataWindow control can be used directly in the C # form.
3. Design DataWindow
Design the data window in the PB or DataWindow design environment, and save it to .PBL for program calls.
After the release, you can compile it into a .pbd file format.
4. C # Molded DataWindow
a) Creating a DataWindow control on the form is DW.
b) Creating a Transaction control on the form is TRANS.
c) Initialize Transaction control
TRANS.DBMS = Sybase.DataWindow.dbmstype.Oledb; // Database connection method
TRANS.PASSWORD = "123";
Trans. userid = "sa";
TRANS.AUTOCOMMIT = FALSE;
TRANS.LOCK = "RC";
Trans.dbparameter = "provider = 'sqloledb', datasource = 'xiancai',
Providerstring = 'database = demo' "; // Database connection string
Trans.Connect (); // Connect the database
d) Display data window
dw.libraryList = "test.pbl"; // After release, use .PBD files
dw.dataWindowObject = "dataWindowname"; // Data window name
dw.settransaction (trans);
dw.Retrieve (); // Display Diversisle
e) Turn off the connection
Trans.disconnect ();
5. C # Using DataWindow control operation data
a) Add
INT row = this.dw.insertrow (0); // Insert a record
Dw.setrow (row);
dw.setItemString (Row, "ID", "100"); / / assigning fields
Dw.setItemString (Row, Name "," Name "); // Assign a value to the field
b) Delete
THIS.DW.DELETEROW (1); // Delete the first line record
c) Save
THIS.DW.UPDATEDATA (TRUE, TRUE);
Trans.commit (); // Write the database after submission
6. Description
The above is just a brief explanation of the use of DataWindow in C #, which will encounter a lot of details during the actual development process, especially when designing the data window.
I also use it shortly, welcome to exchange.
MSN: Yutao728@hotmail.com