Click here to Skip to main content
11,635,098 members (76,463 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
 
ALTER PROCEDURE dbo.select_data
	
AS
 
Declare @OutResult int
 
set @OutResult  ='50'
 
SELECT     [user_id], name1, address, mob, city, emailid
FROM         [user.] 
 
	RETURN
 


i have table : User
fields are:
Userid
name1
address
mob
city
emailid

i have taken gridview in which data is display according to this select query.
now i have to display OutResult with this exsisting data.OutResult is not in any table.

How to do this?
Posted 20-Feb-13 7:15am
Edited 20-Feb-13 8:06am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

use this to declare OutResult as this not in any table
Declare @OutResult int
set @OutResult='50';

but tell me where you have to store this value or just want to display this
  Permalink  
Comments
Member 9511889 at 20-Feb-13 14:00pm
   
i have to just display it in gridview.
you are right that i have to use Declare @OutResult int
hinaiqbal at 12-Mar-15 14:42pm
   
accept the solution if it is helpful to you
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

use this


ALTER PROCEDURE dbo.select_data
 
AS
Declare<pre lang="cs">@OutResult int
set @OutResult='50';
SELECT     [user_id],@OutResult as OutResult, name1, address, mob, city, emailid
FROM         [user.]


and where you are using your stored procedure using reader.HasRows retrive this and use this anywhere you want
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,736
1 Sergey Alexandrovich Kryukov 8,419
2 Mika Wendelius 6,845
3 F-ES Sitecore 2,354
4 Suvendu Shekhar Giri 2,205


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100