
CreateDatabase
ODBPPLib.IODBPP.CreateDatabase creates a new ObjectDatabase Control file (*.odc) that contains all the information required control all the tables and transactions within the database.void CreateDatabase ( string controlFileName );
Parameters
| controlFileName | '\0' terminating string that contains the required path for the control file. |
Return Values
Remarks
- This method also opens the database for use.
Example Use
- C#
private void button1_Click(object sender, EventArgs e){
try{
OpenFileDialog dlg = new OpenFileDialog();
DialogResult result = dlg.ShowDialog();
if (result == DialogResult.OK)
{
ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP();
odbpp.CreateDatabase(dlg.FileName);
odbpp.BeginTransaction(odbpp.EXCLUSIVE, 60000);
ODBPPLib.TableSchema schema = new ODBPPLib.TableSchema();
schema.tableName = "First";
schema.fields.Add(odbpp.UINT32, 0, 0, "First", null);
schema.fields.Add(odbpp.FLOAT32, 0, 0, "Second", null);
schema.indexes.Add(0, odbpp.B_TREE, 0, 0, 0, null);
schema.indexes[0].segments.Add(0, 0);
tableId = odbpp.CreateTable(schema);
}
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
}Also See
CloseDatabase, OpenDatabaseListen All
Comments (0)

