【问题标题】:How to validate which data (rows) to load to a DB from a table in excel?如何验证要从 excel 表中加载到数据库的数据(行)?
【发布时间】:2019-11-03 22:53:37
【问题描述】:

我有一个 3 列 5 行的 excel 表,只要满足要求(我的意思是行),我想上传到数据库

例如:如果在 5 行中,在“成本”列的第三行中输入“百”(西班牙语“cien”)或任何其他词,则仅向数据库收取第 1、2 行的费用, 4 和 5。

ID Name  cost
1  Juan  100
2  Pablo 200
3  Jose  cien
4  Maria 400
5  Pedro 500

Excel table

我在 asp.net web 和 sql server 2014 上使用 C#

【问题讨论】:

    标签: c# sql excel ssis webforms


    【解决方案1】:

    您可以在 sql server 端指定global errors,这是最佳实践。使用向导,您可以将“on error”列设置为“Ignore the error”并继续加载数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多