Results 1 to 4 of 4

Thread: Saving a Created DataBase (Not Solved, But found an alternative way)

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    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();
    Last edited by Tec-Nico; May 28th, 2003 at 01:26 AM.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width