如何以指定格式返回数据集 [英] how to return a Data set in specified format

查看:89
本文介绍了如何以指定格式返回数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi

我正在ASP.net的WebService中返回一个数据集,该数据集正在从数据库中返回一些数据,我想返回该数据,例如
D1 | 2,D1 | 3

在这里和逗号应添加到必须返回的数据集中



在Advance中致谢

hi

I am Returning a Dataset in WebService of ASP.net which is returning some data from database and i would like to return that data like
D1|2,D1|3

in here the | and comma should be added to the dataset which has to be return



Thanks in Advance

推荐答案

您的问题和方案不太清楚.让我尝试一下:
-如果您要谈论数据集中的各种表,则无需执行将它们单独存储的任何操作.
-如果要谈论数据集的数据表中的数据,则再次需要在查询级别处理它,或者可能在业务逻辑层中对其进行更改
-如果您要一次从一个网络方法转移多个数据集,那么:
1.为什么要这么做?您可以将所有数据集中在一个数据集中并传输
2.即使您需要它,为什么还要使用一些分隔符?使用集合.

底线:建议不要更改数据集格式,也不应该做/要问正确的事.根据方案进行适当处理.数据集遵循Diffgram的特定格式,该格式有助于数据集相关的功能,因此不应使用.
Your question and scenario are not quite clear. Let me try though:
- If you are talking of various tables in a dataset then you don''t need to do anything they are separately stored.
- If you are talking of data in datatable of dataset then again you need to handle it at query level or might be in business logic layer to make changes in it
- If you are talking of transferring more than one dataset at a time from a webmethod, then:
1. Why would you do that? You can have all in one dataset and transfer
2. Even if you need it, why do you want to use some separator? Use collections.

Bottomline: Changing dataset format is not suggestible or the right thing to do/ask. Based on the scenario handle it appropriately. Dataset follows a specific format of Diffgram which helps in dataset related features and thus should not be played with.


这篇关于如何以指定格式返回数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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