最佳实践文件上传到数据库 [英] Best Practices for uploading files to database

查看:140
本文介绍了最佳实践文件上传到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找的是如何创建一个接口,从.NET Web应用程序数据库上传的Excel文件数据的最佳做法或想法 我应该使用一种机制,允许所有的记录被加载并标记错误,或者我应该用当错误发生时停止负载的机制。

I am looking for any best practices or ideas on how you would create an interface with a DB from a .NET web application to upload data from Excel files Should I use a mechanism that allows all the records to be loaded and flags the errors or should I use a mechanism that stops the load when an error occurs.

我从未有过这样的帮助将是超级对付这种类型的需求!

I've never had to deal with this type of requirement before so any help would be super!

感谢

推荐答案

如果在你的数据库数据的完整性是非常重要的,不允许的数据要导入有错误或不符合您的数据库的验证要求。

If data integrity in your DB is important, do not allow data to be imported that has errors or does not meet the validation requirements of your DB.

由于这些是Excel文件,应该是,而不是试图使用另一个接口来修正数据容易足以使用户校正在Excel文件中的数据,。只要确保该错误信息将用户引导到什么领域的问题,并清楚地解释什么是错的。

Since these are Excel files, it should be easy enough for the user to correct the data in the Excel file, instead of trying to use another interface to fix the data. Just make sure the error messages direct the user to what field is the problem and clearly explain what is wrong.

这篇关于最佳实践文件上传到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆