简体   繁体   English

如何验证要从 excel 中的表加载到数据库的数据(行)?

[英]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

Excel table Excel表

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.

相关问题 如何在数据表 c# 中按需加载 excel 行 - How to load on demand excel rows in a data table c# 列出完整的数据库数据行; 如何将字段加载到标签? - List full of rows of db data; how to load fields to labels? 如何从C#中获取Excel中特定列中包含数据的所有行 - How to get all the rows which contain data in a particular column in Excel from C# 在将数据绑定到详细信息视图之前如何验证数据库中的字段 - how to validate fields from DB before binding the data to the details view 实体框架:如何从数据库表中尚不存在的列表中插入数据 - Entity Framework: How to insert data from a list which does not already exists in DB table 如何从Excel中获取唯一的列数据,该数据在C#的数据库表列中 - how to fetch the only column data from excel which is there in database table column in c# 如何从excel文件中计算表中受影响的行数 - how to count number of rows affected in Table from excel file 在VSTO中如何从Excel中的表中删除行 - In VSTO how can I delete rows from a Table in Excel 如何从存储在数据库中的Excel二进制数据获取范围 - How to get range from excel binary data stored in db 从C#,如何验证MS Access DB中是否已经存在表 - From C#, How to validate whether Table is already exists in MS Access DB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM