Saving a Created DataBase (Not Solved, But found an alternative way)
Alright, I am using ADO.Net... And so I created the DataBase with a lot of efforts... Good!
But now.. How do I save it?
Here is what I did:
Code:
this.oDs = new DataSet(DictionaryModule.myDB.Nombre);
Console.WriteLine("DataBase:" + DictionaryModule.myDB.Nombre);
DataTable oDtbl;
DataColumn oDclm;
foreach(DictionaryEntry myEntry in DictionaryModule.myDB){
Tabla tbl = DictionaryModule.myDB.Item(myEntry.Key.ToString());
Console.WriteLine("Table: " + tbl.Nombre);
oDtbl = new DataTable(tbl.Nombre);
foreach(string col in tbl.Columnas){
oDclm = new DataColumn(col);
Console.WriteLine("Column: " + col);
oDtbl.Columns.Add(oDclm);
}
this.oDs.Tables.Add(oDtbl);
}
//Create DataBase
System.IO.FileStream fileDB = new System.IO.FileStream(this.DBName + ".mdb", System.IO.FileMode.Create);
//How do I save it? :(
fileDB.Close();
this.oDs.Dispose();