I have a button which make it add data to accees database,but i want to another button which will make export data from access to excel.
here is my button :
try
{
string cmdText = "Insert INTO data(Name,Mail) Values(?,?)";
db_conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Alpozkanm\\Documents\\Visual Studio 2012\\WebSites\\IntegratedSubscribeSystem\\veri.accdb;Persist Security Info=False;");
OleDbCommand db_command = new OleDbCommand(cmdText, db_conn);
db_conn.Open();
db_command.Parameters.AddWithValue("@p1", TextBox1.Text);
db_command.Parameters.AddWithValue("@p2", TextBox2.Text);
db_command.ExecuteNonQuery();
Label5.Text = "Succesfully!";
}
catch (Exception ex)
{
Response.Write("There is something wrong!" + ex.Message);
}
What is the second button codes ?
Any Suggestion ?
BTW,
I use visual studio 2012,Access and Excel 2010