将excel文件与其他一些列一起插入sql server表 [英] Insert a excel file into a sql server table along with some other columns

查看:80
本文介绍了将excel文件与其他一些列一起插入sql server表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含4列的excel文件,我有一个带有6个列的sql server 2008表,因为excel文件中没有两列。

在上传excel文件(批量)时我必须从用户(下拉列表)中读取两列值并将它们与excel文件一起上传。请帮忙。



Ex:



Excel文件列(R.No,Name,Father Name,性别)

Sqlserver列(分支,年份,R.No,姓名,父姓,性别)



输入分支:

输入年份:

上传Excel文件:__________(浏览Excel文件)



上传按钮

解决方案

首先从excel获取所有值到数据集和数据集将有6列。

然后获取其他2列和更新数据集的值。

I have an excel file with 4 columns and i have a sql server 2008 table with 6 colums, in that two columns are not there in the excel file.
while uploading the excel file (bulk) i have to read the two columns values from the user(drop down list) and upload them along with excel file. please help.

Ex:

Excel file columns(R.No, Name, Father Name, Gender)
Sqlserver columns(Branch, Year,R.No, Name, Father Name, Gender)

Enter Branch:
Enter Year:
Upload Excel File:__________(Browse for Excel File)

Upload Button

解决方案

First get All value from excel into Data set & data set will have 6 Column.
Then get value for other 2 column & update data set.


这篇关于将excel文件与其他一些列一起插入sql server表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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