[英]How to validate which data (rows) to load to a DB from a table in excel?
I have an excel table of 3 columns and 5 rows, which I want to upload to the DB as long as they meet the requirements (I mean the rows)我有一个 3 列 5 行的 excel 表,只要符合要求,我就想上传到数据库(我的意思是行)
For example: If of 5 rows, in the third row of the column "cost" you put the word "hundred"(in spanish "cien") or any other, only charge to the DB the row 1, 2, 4 and 5.例如:如果有 5 行,在“成本”列的第三行中输入“百”(西班牙语“cien”)或任何其他词,则仅向数据库收取第 1、2、4 和 5 行的费用.
ID Name cost
1 Juan 100
2 Pablo 200
3 Jose cien
4 Maria 400
5 Pedro 500
I'm using C# on asp.net web and sql server 2014我在 asp.net web 和 ZAC5C74B64B4B8352EF2F18AZ1AFFB5AC24 服务器上使用 C#
You can specify global errors on the sql server side as it's best practice.作为最佳实践,您可以在 sql 服务器端指定全局错误。 Using the wizard you can set the "on error" column to "Ignore the error" and keep loading the data.使用向导,您可以将“出现错误”列设置为“忽略错误”并继续加载数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.