简体   繁体   English

基于C#中的模板批量上传数据

[英]Bulk upload of data based on a template in c#

We have a web application where users can create certain type of records from a web page. 我们有一个Web应用程序,用户可以在其中从网页创建某些类型的记录。 There are many mandatory fields on the webform and users will need to fill all in order to save the data. Web表单上有许多必填字段,用户将需要填写所有内容以保存数据。

Now we need to provide a functionality to users so that they can download a MS Excel template or other template and user will provide bulk data based on the format provided. 现在,我们需要向用户提供功能,以便他们可以下载MS Excel模板或其他模板,并且用户将根据所提供的格式提供批量数据。

Did you guys ever do anything of this sort. 你们有没有做过这样的事情? Any ideas greatly appreciated. 任何想法表示赞赏。

My main concern with the above approach is that we need to validate the data user provides in the Excel sheet. 我对上述方法的主要担心是,我们需要验证用户在Excel工作表中提供的数据。 Are there any 3rd party tools/Components that do this? 是否有任何第三方工具/组件可以做到这一点?

Thanks in advance 提前致谢

Have the client upload the excel file. 让客户端上传excel文件。 Open it as a data source, validate the data (DataTable object). 将其作为数据源打开,验证数据(DataTable对象)。 If there are any errors, return a list of errors to the user. 如果有任何错误,请向用户返回错误列表。 You can do this all in .NET 您可以在.NET中完成所有操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM