tetepoive
August 15th, 2009, 09:59 AM
Hello,
I'm a french student and I have a problem with asp.net/c# and oledb excel.
I open an excel file and write in the first sheet called Sheet1 but my problem is that eveytime i write in the sheet in a specific cell the value is write only on the first line.For exemple if i want to write in the cell G15 the value that I give to the cell is write in the line G1.I show you the code that i have in my file :
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "\\controle\\excel\\" + recuperation_fichier.FileName + ";Extended Properties='Excel 12.0 Xml;HDR=NO;FirstRowHasNames=NO;'";
OleDbConnection connExcel = new OleDbConnection(connectionString);
connExcel.Open();
OleDbCommand cmdExcel = new OleDbCommand("UPDATE [feuil1$F3:G3] SET F1='milouse',F2='momo'",connExcel);
cmdExcel.ExecuteNonQuery();
Someone can help me?
Excuse me for my english.
I'm a french student and I have a problem with asp.net/c# and oledb excel.
I open an excel file and write in the first sheet called Sheet1 but my problem is that eveytime i write in the sheet in a specific cell the value is write only on the first line.For exemple if i want to write in the cell G15 the value that I give to the cell is write in the line G1.I show you the code that i have in my file :
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "\\controle\\excel\\" + recuperation_fichier.FileName + ";Extended Properties='Excel 12.0 Xml;HDR=NO;FirstRowHasNames=NO;'";
OleDbConnection connExcel = new OleDbConnection(connectionString);
connExcel.Open();
OleDbCommand cmdExcel = new OleDbCommand("UPDATE [feuil1$F3:G3] SET F1='milouse',F2='momo'",connExcel);
cmdExcel.ExecuteNonQuery();
Someone can help me?
Excuse me for my english.