Skip to content

Commit 909a8eb

Browse files
committed
增加Excel表中主键列列名是否与其他列重复的检测
1 parent d165887 commit 909a8eb

5 files changed

Lines changed: 4 additions & 2 deletions

File tree

XlsxToLua/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
3333
// 方法是按如下所示使用“*”:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("6.0.0.0")]
36-
[assembly: AssemblyFileVersion("6.0.0.0")]
35+
[assembly: AssemblyVersion("6.1.0.0")]
36+
[assembly: AssemblyFileVersion("6.1.0.0")]

XlsxToLua/TableAnalyzeHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public static TableInfo AnalyzeTable(DataTable dt, string tableName, out string
8282

8383
// 存储定义过的字段名,不允许有同名字段(key:字段名, value:列号)
8484
Dictionary<string, int> fieldNames = new Dictionary<string, int>();
85+
// 先加入主键列
86+
fieldNames.Add(tableInfo.GetKeyColumnFieldInfo().FieldName, 0);
8587
// 解析剩余的列
8688
while (curColumnIndex < dt.Columns.Count)
8789
{

XlsxToLua/XlsxToLua.v12.suo

1 KB
Binary file not shown.

XlsxToLua/bin/Debug/XlsxToLua.exe

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)