I have read excel data to c# console application and done some data cleaning operations on Phone Numbers column. The result I have stored in an 2D array as PhoneNumber[,] which contains 7 rows and 13 columns of data. I have divided and Phone numbers and etc. My question is how can I write the array data into excel sheet using Oledb
System.Data.OleDb.OleDbConnection MyConnection;
System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
string sql = null;
MyConnection =new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"");
MyConnection.Open();
myCommand.Connection = MyConnection;
enter code here sql = "Insert into [Sheet1$] (ph1,type1,lines1,ph2,type2,lines2,ph3,type3,lines3,ph4,type4,lines4) values(?)";
myCommand.CommandText = sql;
myCommand.ExecuteNonQuery();
MyConnection.Close();
Can someone please help me how can i write the data?