R
Reddy
Hi,
I need to insert records into two tables another after the other. Is the
following code ok or is there a more efficient way of doing this using
sqlcommand object
con.Open()
strSql="insert into table1(column1) values('test1')"
cmd = New OdbcCommand(strSql, con)
cmd.ExecuteNonQuery()
cmd.Dispose()
strSql="insert into table2(column1) values('test2')"
cmd = New OdbcCommand(strSql, con)
cmd.ExecuteNonQuery()
cmd.Dispose()
con.Close()
Thanks,
Srinivas
I need to insert records into two tables another after the other. Is the
following code ok or is there a more efficient way of doing this using
sqlcommand object
con.Open()
strSql="insert into table1(column1) values('test1')"
cmd = New OdbcCommand(strSql, con)
cmd.ExecuteNonQuery()
cmd.Dispose()
strSql="insert into table2(column1) values('test2')"
cmd = New OdbcCommand(strSql, con)
cmd.ExecuteNonQuery()
cmd.Dispose()
con.Close()
Thanks,
Srinivas