Inserting Default Data

In the next version there will be a new way of inserting default data into a table below are some descriptions of how this can be done.

It can be used using the table command.

            Table table = db.AddTable("Table1");
            table.AddColumn<string>("Name", 20);
            table.Insert(new {ID = 1, Name = "Hello World"});            

Or alternative through the Dataprovider, for example if the table already exists.

            // db.InsertDataInto("TableName", objectToUse, IsIdentityField);
            db.InsertDataInto("Table1", new { ID = 1, Name = "Hello World" }, true);

Last edited Mar 29, 2008 at 4:12 PM by AndyStewart, version 2


No comments yet.