如何将多个文本文件绑定到asp.net中的gridview [英] how to bind multiple textfiles to gridview in asp.net

查看:76
本文介绍了如何将多个文本文件绑定到asp.net中的gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生,

我在一个文件夹中有多个文本文件.我想将所有这些文件绑定到gridview.如何执行此任务.

请任何人建议我.

谢谢.

hello sir,

I have multiple textfiles in a folder. I want to bind these all files to gridview. how to do this task.

Please any body suggest me.

Thanking you.

推荐答案

如果这是您希望绑定的文件内容,我可以想到两种方法:

创建一个主文件,然后将其他文件的内容复制到该文件中.将GridView绑定到主文件.

使用数据表创建一个数据集.可以从单独的文本文件填充每个DataTable.然后,您可以操纵表...创建关系或使用 Merge ()函数来组合DataTables或手动复制行和单元格.然后,您可以绑定到结果数据表.
If it''s the file contents you wish to bind to, I can think of two approaches:

Create a master file and copy the contents of the other files into that. Bind the GridView to the master file.

Create a DataSet with DataTables. Each DataTable can be filled from a seperate text file. Then you can manipulate the tables...create relations or use the Merge() function to combine DataTables or manually copy rows and cells. Then you can Bind to the resultant DataTable.


这篇关于如何将多个文本文件绑定到asp.net中的gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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