p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > SQL Server > SQL Server 2005 > SQL Server 2005
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2005 General discussion of SQL Server *2005* version only.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 12th, 2009, 06:51 AM
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Jul 2009
Posts: 13
Thanks: 0
Thanked 1 Time in 1 Post
Default Retrieving a result set from stored procedure

Hallo everybody,

I wrote a stored procedure that executes on the MS-SQL Server.

I would like to store the returned set of attributes in a variable that I can retrieve in my C# application. The procedure code looks like this:

CREATE PROCEDURE Select_InnerJoin_Memo
AS
SELECT Memo.Title, Memo.Body, Status.Status, Users.UserName AS
Author FROM Memo INNER JOIN Users ON Memo.MadeBy = Users.Id INNER JOIN Status ON Memo.Status = Status.Id
GO
EXECUTE Select_InnerJoin_Memo

The procedure returns the required results on the server but now I would like to get the returning attributes into a table variable so I can later use it in C# and fill a DataGridView. I allready declared a table variable like:

DECLARE @ResultSet TABLE
(
Title char(50),
Body char(50),
...
)

and put the '@ResultSet' = after the SELECT keyword but with no success .


Any help?

Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 12th, 2009, 09:11 AM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
Default

Please check the following tutorials:

Walkthrough: Displaying Data Using a Stored Procedure in the GridView Web Server Control
http://msdn.microsoft.com/en-us/libr...y1(VS.80).aspx

How to display data using the .NET GridView Control, stored procedures, ASP.NET 2.0 and VB.NET
http://www.aspnettutorials.com/tutor...spnet2-vb.aspx
__________________
Om Prakash Pant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 12th, 2009, 11:45 AM
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Jul 2009
Posts: 13
Thanks: 0
Thanked 1 Time in 1 Post
Default Thank you

That's it !
Thank you very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
result set rajesh_css SQL Language 2 May 18th, 2009 04:33 PM
Empty result set from mysql stored procedure talz13 PHP Databases 3 December 28th, 2008 05:58 PM
stored procedure with two result sets joxa83 SQL Server 2000 14 July 18th, 2007 02:03 AM
How to set Oracle Stored Procedure Timeout jcslam Oracle 0 October 18th, 2004 04:38 AM
Result set jemacc SQL Server 2000 0 December 19th, 2003 07:26 PM



All times are GMT -4. The time now is 05:26 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc