Hallo, I have folowing code:
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.xls;Extended Properties=\"Excel 8.0;Imex=1;HDR=False;\"");
OleDbDataAdapter da = new("select * from [" + TableName + "$]", con);
DataSet dsData = new System.Data.DataSet();
con.Open();
da.Fill(dsData);
dataGridView1.DataSource = dsData.Tables[0];
I try read the Data from file created by Excel 2007 SP2.
If my Excel-File (test.xls) is closed, the formatting of the cells with the numbers is right in the Table of dataGridView1.
Like this: 5,0 (formated with one comma place) shows as 5,0
If my Excel-File (test.xls) is opened, the formatting of the cells with the numbers is not right.
Like this: 5,0 shows as 5 !!!
Excel 2007 SP2 Microsoft Visual C# 2008 .Net Framework 2.0
Thank you for every help