导入具有相同列名的Excel [英] Import Excel with same column names

查看:218
本文介绍了导入具有相同列名的Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在C#中使用OleDB导入Excel .xls ir xlsx.问题在于Excel文件可能包含多个具有相同名称的列,而我想保留它们....现在发生的是DataTable正在使它们递增,这是我不希望的问题.
前任. AA BB CC AA1 BB CC1而不是AA BB CC AA BB CC

Hi,

I am using OleDB with C# to import a Excel .xls ir xlsx. The problem is that the Excel file may contain multiple column with the same name, and I want to keep them... What is happening now is that the DataTable is incrementing them an issue that I do not want.
ex. AA BB CC AA1 BB CC1 instead of AA BB CC AA BB CC

推荐答案

在我看来,这是一个很好的解决方案,因为不可能重复我遇到过的任何数据库系统中的列名称.
That would seem to me to be a good solution, since it is not possible to have duplicate column names in any database system I have ever encountered.


老兄.
在处理数据表时,您不应该在任何数据表中添加两个具有相同名称的列.
Hi Dude.

When dealing with DataTables you are not supposed to add two columns with same names to any datatable.


这篇关于导入具有相同列名的Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆