为什么从CSV列名的文件不是其数据表有什么不同? [英] Why is the column name from a CSV file different than its DataTable?
问题描述
我用一个OleDbConnection,OleDbCommand的,和OleDbDataReader读取一个CSV文件导入数据表。
I'm using an OleDbConnection, OleDbCommand, and OleDbDataReader to read a CSV file into a DataTable.
CSV文件使用的第一行作为标题行。
The CSV file uses the first row as a header row.
中的一些标题中的名称中有非字母数字字符等(_。/)。
Some of the names in the header have non alphanumeric characters like ( _ . / ).
在系统创建的列名被转置。 (期)字符到#(井号)。
When the system creates the Column names it is transposing the . (period) character into a # (pound sign).
为什么是这个角色正在发生变化,有没有办法阻止的变化,使得。 (期)留在列名?
Why is this one character being changed and is there a way to stop the change, making the . (period) stay in the column name?
感谢你,
基思
Thank you,
Keith
推荐答案
它更换周期,因为他们的元字符在SQL中指定的层次结构。我不相信这是个好办法,试图preserve时期。
It's replacing periods because they're metacharacters in SQL for specifying hierarchies. I don't believe it's at all advisable to try to preserve the period.
这篇关于为什么从CSV列名的文件不是其数据表有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!