任何人都告诉我该怎么做 [英] any one tell me how to do this

查看:62
本文介绍了任何人都告诉我该怎么做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格视图,其中显示了excel表格整个数据

现在我想获得列名

但问题是我不知道索引因为索引将在运行时更改,所以我怎么能这样做

i have a data gird view in which a excel sheet whole data is shown
now i want to get column name
but question is that i dont know the index of the column because index will be change at run time so how can i do that

推荐答案

如果您已在连接字符串中读取带有第一个Row标题的excel文件Excel文件然后第一行中不同列中的每个值都将被视为DataTable和GridView的列名。
If you have read the excel file with first Row header in the Connection string for Excel file then each value in the different column in very First Row would be treated as column name for your DataTable & GridView.


这篇关于任何人都告诉我该怎么做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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