开发者

Excel having columns with dot(.)

I am working in c# windows forms product.

I am exporting some data to an excel.these data are inputted by the user.the rows in he dataset are made columns in the excel.these column names has 'dot'. While exporting,these columns remain the same.But while trying to import back the data,the column names which are having dot will have # in the dataset

eg..initially it was开发者_开发技巧 A.B,now in dataset it is A#B.

on the client side i cannot simply convert # to dot as the user can also give input with #.Please help me to solve this problem.I am not able to find a solution.

Thanks

Neethu


On your connectionString, set HDR=No. Now DataSet treats column names as rows and you will get the data as it is there in the excel.

string cnnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"C:\\Untitled 1.xls\";Extended Properties=\"Excel 8.0;HDR=No;IMEX=1\"";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜