Passing data from one database to another database table (Access) (C#)
Posted
by
SAMIR BHOGAYTA
on Samir ASP.NET with C# Technology
See other posts from Samir ASP.NET with C# Technology
or by SAMIR BHOGAYTA
Published on 2010-01-28T04:34:00.000-08:00
Indexed on
2010/12/06
17:00 UTC
Read the original article
Hit count: 571
Passing data from one dat
OLEDB:Database Password=12345";
OleDbConnection dbconn = new OleDbConnection();
OleDbDataAdapter dAdapter = new OleDbDataAdapter();
OleDbCommand dbcommand = new OleDbCommand();
try
{
if (dbconn.State == ConnectionState.Closed)
dbconn.Open();
string selQuery = "INSERT INTO [Master] SELECT * FROM [MS Access;DATABASE="+
"\\Data.mdb" + ";].[Master]";
dbcommand.CommandText = selQuery;
dbcommand.CommandType = CommandType.Text;
dbcommand.Connection = dbconn;
int result = dbcommand.ExecuteNonQuery();
}
catch(Exception ex) {}
© Samir ASP.NET with C# Technology or respective owner