如何从存储过程中检索数据表 [英] How do retrieve data table from stored procedure

查看:133
本文介绍了如何从存储过程中检索数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我可以使用示例存储过程代码,它将返回一个数据表



查询将是select * from TableName



我怎样才能在C#代码中收到此值





谢谢,

praveen Machat

Dear Friends,

Can I have, sample stored procedure code ,which will return a data Table

query will be "select * from TableName"

and how can I receive this value in C# code


Thanks,
praveen Machat

推荐答案

就像你执行时一样直接查询:将SqlDataAdapter放入DataTable或DataSet,或者使用SqlDataReader。您的选择。



执行存储过程与您直接以文本查询方式发布过程中的代码完全相同。



错字:确实是SqlDateReader! - OriginalGriff [/ edit]
The same way you would if you were executing the query directly: with an SqlDataAdapter into a DataTable or DataSet, or with a SqlDataReader. Your choice.

Executing a stored procedure is exactly the same as if you had issued the code inside the procedure directly as a text query.

[edit]Typo: SqlDateReader indeed! - OriginalGriff[/edit]


您好,



使用以下链接



http:// stackoverflow.com/questions/18717071/how-to-retrieve-all-data-from-sql-server-2008-in-asp-net [ ^ ]

从sql server获取数据并插入int asp.net文本框 [ ^ ]

http://www.dotnetcurry.com/showarticle.aspx?ID=278 [ ^ ]
Hi,

Use below links

http://stackoverflow.com/questions/18717071/how-to-retrieve-all-data-from-sql-server-2008-in-asp-net[^]
fetch data from sql server and insert int asp.net textbox[^]
http://www.dotnetcurry.com/showarticle.aspx?ID=278[^]


这篇关于如何从存储过程中检索数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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