如何使用ASP.NET C#更改现有数据集中的数据表顺序? [英] How to change datatable order in an existing dataset using ASP.NET C#?

查看:63
本文介绍了如何使用ASP.NET C#更改现有数据集中的数据表顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用asp.net c#更改现有数据集中的数据表顺序。我从数据库中获取数据并添加到数据集中。但是需要更改表的顺序,因为我需要按照要求的顺序将其写入文本文件。



我尝试过:



我从数据库中获取数据并添加到数据集中。但是需要更改表的顺序,因为我需要以所需的顺序将其写入文本文件。

I want to change datatable order in an existing dataset using asp.net c#. I am fetching data from DB and adding to a dataset. But the order of tables need to be changed as i need to write the same to a text file in the required order.

What I have tried:

I am fetching data from DB and adding to a dataset. But the order of tables need to be changed as i need to write the same to a text file in the required order.

推荐答案

您可以:

1.按索引号或表名称引用数据集中的各个数据表;或者

2.按照您想要的顺序将数据表复制到新数据集。
You can either:
1. Refer to individual datatables in the dataset by their index numbers or table names; or
2. copy the datatables to a new dataset in the order that you want.


这篇关于如何使用ASP.NET C#更改现有数据集中的数据表顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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