I have the following code on a button, but when I run the program I get the following error:
Format of the initialization string does not conform to specification starting at index 54. no controo argument exeption:
Here is the code
private void button3_Click(object sender, EventArgs e)
{
string conexion = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\Users\MICUENTA\Libraries\Documents\Copy.xlsx;Extended Properties=Excel 12.0;";
OleDbConnection origen = default(OleDbConnection);
origen = new OleDbConnection(conexion);
OleDbCommand seleccion = default(OleDbCommand);
seleccion = new OleDbCommand("select * from [Sheet1$]", origen);
OleDbDataAdapter adaptador = new OleDbDataAdapter();
adaptador.SelectCommand = seleccion;
DataSet ds = new DataSet();
adaptador.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
origen.Close();
SqlConnection conexion_destino = new SqlConnection();
conexion_destino.ConnectionString = ("MI BASE");
conexion_destino.Open();
SqlBulkCopy importar = default(SqlBulkCopy);
importar = new SqlBulkCopy (conexion_destino);
importar.DestinationTableName = "tbl_Volumen2";
importar.WriteToServer(ds.Tables[0]);
conexion_destino.Close();
}