Build the sample. The plugin (VBSample53.dll or CSSample53.dll) and the associated .tbp file are copied to the AutoCAD Map 3D Client bin directory.
Start AutoCAD Map 3D and open the TBSAMPLE workspace.
Click the application toolbar button with the Sample 53 - Connection Tools caption. The new form is displayed.
If you have run the sample previously (you can use Step 6 to determine if the table exists) and want to start again from the beginning, you must remove the sample_person table from the database. In an Oracle SQL*Plus session enter the following commands:
drop table sample_person cascade constraints;
Click Create Data Structure For Sample. The handler for this button uses the Autodesk.Map.IM.Data.Tools.DataStructure class. An information dialog box is displayed with the Creating Structure text. Click OK.
Verify that the table was created and determine its structure. In an Oracle SQL*Plus session, enter the following commands:
select table_name from user_tables where table_name = ‘SAMPLE_PERSON’;
Click Write Data. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to set name/value pairs before performing the SQL command. An information dialog box is displayed with the There are 0 values in SAMPLE_PERSON text. Click OK.
A message box is displayed with a SQL statement for an insertion into SAMPLE_PERSON. Click OK. The inserted data is displayed in the list box; the source of the data is a select on SAMPLE_PERSON. This pattern of events is repeated several times with some of the SQL statements being insertions and some being updates.
Click Read Data. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordReader class. Some data from each row in the SAMPLE_PERSON table is displayed in the list box.
Click Read Array. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordBuffer and the Autodesk.Map.IM.Data.Tools.ConnectionTools classes. A message box is displayed with the Gabi del la Blub has Size 0.58 text. Click OK.
Click Save Object Properties. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to serialize properties extracted from an object before executing the insert SQL statement.
Click Load Object Properties. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordReader class to select a row from SAMPLE_PERSON and deserialize the properties to create an object. A message box is displayed with information extracted from the object. Click OK.
Click Write SQL Loader File. The handler for this button uses the Autodesk.Map.IM.Data.Tools.SqlExport class to extract rows from SAMPLE_PERSON and write them to a file. A text editor window is displayed displaying the extracted information. Close the window.
Click Read Buffer. The handler for this button uses Autodesk.Map.IM.Data.Tools.RecordReader class to select a row from SAMPLE_PERSON, uses the select results to create an object, displays two of the object’s properties in a message box, changes one of the object properties that was displayed and then uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to extract the object properties and update the corresponding row in the SAMPLE_PERSON table. Finally, it displays the updated row in the list box.