void InserttestTable(testTable instance) { using (var cmd = Connection.CreateCommand()) { cmd.CommandText = "SELECT NEXT VALUE FOR [dbo].[seq_PK_testTable] as NextId"; cmd.Transaction = Transaction; instance.id = (int)cmd.ExecuteScalar(); ExecuteDynamicInsert(instance); } }
static void Main(string[] args) { var db = new DataClasses1DataContext(@"Data Source="); var testTableRecord1 = new testTable(); var testTableRecord2 = new testTable(); db.GetTable <testTable>().InsertOnSubmit(testTableRecord1); db.SubmitChanges(); db.GetTable <testTable>().InsertOnSubmit(testTableRecord2); db.SubmitChanges(); }