i want import Excel work sheet into ms acess existing table
try
{
string conn = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + filename + ";" + "Extended Properties=Excel 12.0 Xml;";
OleDbConnection con = new OleDbConnection(conn);
OleDbCommand cmd = new OleDbCommand();
con.Open();
cmd.CommandText = @"SELECT * INTO [MS Access;Database=" + adb + "].[test] FROM [test$]";
cmd.Connection = con;
cmd.ExecuteNonQuery();
MessageBox.Show("inserted");
con.Close();
}
catch (DbException ex)
{
MessageBox.Show("Failed to access database");
MessageBox.Show(ex.Message);
return;
}
but its create new table and insert values?
how i insert existitg existing databases ms access