命名查询返回的表 [英] Naming the tables returned from queries

查看:79
本文介绍了命名查询返回的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想知道是否可以给在MYSQL结果中返回的表命名,以便通过.NET通过它们的名称访问它们.

例如,返回美国州的表必须调用州:

Hello,
I was wondering if I could give names to the tables that are returned in the MYSQL result in order to access them with .NET through their name.

For example the table that returns the states of America must call States:

Select * from states


结果表的名称应称为状态"

我可以像这样访问查询结果中的表:


name of the result table should call "States"

And I could access the tables in the query’s result like that:

dataSet.Tables["States"];



[edit]标签已更新-Maciej Los [/edit]



[edit]Tags updated - Maciej Los[/edit]

推荐答案

请参阅此文章,其中包含您需要的所有答案.

http://msdn.microsoft.com/en-us/library/ms810286.aspx [ ^ ]

重要提示:没有直接的方法可以直接从存储过程或sql查询中提供数据表名称.
Please refer this article it has all the answers you need.

http://msdn.microsoft.com/en-us/library/ms810286.aspx[^]

Important: There is no direct way to provide datatable name straight from stored procedure or sql query.


这篇关于命名查询返回的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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