我想使用ASP .NET从数据库表中插入数据 [英] I want to insert data from exce to database table using ASP .NET

查看:69
本文介绍了我想使用ASP .NET从数据库表中插入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Asp .Net将数据从Excel插入和更新到数据库。

我的表格列为

I want to insert and Update data from Excel to database using Asp .Net.
I have table which has column as

[Company_id] [int] 
[Name] 
[City] 
[Address] 
[Designation]



现在我想要创建asp .net应用程序以将批量数据从excel文件插入数据库文件,如果公司Id存在于数据库中,那么它应该使用存储过程更新该公司

数据。



我尝试了什么:



我对此没有任何想法所以请任何人都可以提供代码为此


Now I want to create asp .net application to insert bulk data from excel file to database file and if company Id exist in database then It should update that company
data using stored procedure.

What I have tried:

I dont hav any Idea about this so please any one can provide code for this

推荐答案

.NET能够使用各种来源作为数据源,包括文本文件,CSV和Excel ...

所以最好的方法是打开Excel文件作为数据源( Excel连接字符串 - ConnectionStrings.com [ ^ ])并将其保存为SQL ......
.NET has the ability to use various sources as data source, including ,text files, CSV, and Excel...
So probably the best way is to open the Excel file as data source (Excel connection strings - ConnectionStrings.com[^]) and save it to SQL as such...


这篇关于我想使用ASP .NET从数据库表中插入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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