将Excel文件上载到Webform网格中,在网格中进行更改,然后将其复制到数据库中. [英] Upload Excel file into a webform grid, make changes in the grid and copy it into the database.

查看:99
本文介绍了将Excel文件上载到Webform网格中,在网格中进行更改,然后将其复制到数据库中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

由于我是ASP.NET和C#的新手,因此我的项目确实需要一些帮助.我的项目的分步过程如下-

1.浏览一个Excel文件,然后单击上传"按钮,该Excel文件的内容应以网格形式显示在网页上.

2.应该允许用户在网格的单元格中进行更改.

3.将创建另一个名为Submit的按钮.单击它后,它应将该网格的更改内容复制到数据库表中.

我只能做第一步.我需要其他步骤的帮助.

谢谢.

Hey,

As i am new to ASP.NET and C#, i really need some help on my project. The step-wise procedure of my project is given below -

1. Browse for an Excel file and when upload button is clicked, the content of the excel file it should be displayed on the webpage in the form of a grid.

2. User should be allowed to make changes in the cells of the Grid.

3. Another button called Submit is to be created. Upon clicking it, it should copy the changed contents of that Grid into the Database tables.

I have been able to do only the first step. I need help on the other steps.

Thanks.

推荐答案

我相信您唯一的问题是从excel文件中读取,其余的我想您可以自己完成.请尝试以下步骤:

1.将excel阅读到表格中.此链接会有所帮助.
2.在网格中编辑数据.
3.完成编辑后,可以将网格的数据源(在步骤1中设置)取出为DataTable.
4.现在可以将此DataTable更新到数据库.尝试
I believe your only issue is reading from the excel file, rest I think you can do on your own. Try these steps:

1. Read excel to the grid. This link will be of help.
2. Edit data in your grid.
3. Once you are done with editing, you can take out the datasource of the grid(which was set in step 1) as DataTable.
4. Now this DataTable can be updated to the database. Try Google.

Hope this help.


我能够从excel文件中读取信息,并且能够以网格形式显示excel内容.我面临的问题是我无法编辑网格中存在的值或数据.让我知道您是否找到解决方案.
I am able to read from the excel file and also have been able to display the excel content in the form of a grid. The problem that i am facing is that i am not able to edit the values or data present in the grid. Let me know if you find any solution for this.


您好,

请访问以下链接:
单击此处....
hello,

Please visit below link :
Click Here....


这篇关于将Excel文件上载到Webform网格中,在网格中进行更改,然后将其复制到数据库中.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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