Click here to Skip to main content
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
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)



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