User-821857111 posted
var a = Database.Open("a");
var data = a.Query("SELECT * FROM Table1");
var b = DatabaseOpen("b");
//if the table already exists
foreach(var row in data){
b.Execute("INSERT INTO Table1 (col1,col2,col3,...) VALUES (@0, @1, @2...)", row.col1, row.col2,row.col3,...);
}
If the table doesn't exist, you need to create it. You can use
CREATE TABLE for that:
var ddl = "CREATE TABLE Table1 (Col1 IDENTITY NOT NULL PRIMARY KEY, Col2 NVARCHAR(50), Col3 DATETIME etc)";
b.Execute(ddl);