动态映射列在Excel和数据库中 [英] Dynamic Maping Columns In Excel and database

查看:155
本文介绍了动态映射列在Excel和数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从excel文件中获取数据并将该数据存储在sql server表中,并且我只获取excel中的那些数据列,我将其映射到数据库表中的特定列。

I have to fetch data from excel file and store that data in sql server table and i have fetch only those columns of data from excel ,which i mapped with particular columns in database table.

推荐答案

参考这个



从Excel加载GridView [ ^ ]



使用
Refer this

Load GridView from Excel[^]

use the
SqlBulkCopy

方法复制数据或读取记录在数据表中按一个并将其加载到数据库中。



希望它有所帮助。

method to copy the data or read the records one by one in the datatable and load it in the database.

Hope it helps.


这篇关于动态映射列在Excel和数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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