Bind a Status Column in gridview on basis current Date
I have customer registration form in that iam not using any status field n not saving it in data base so when iam retrieving records from this table then how to bind one extra column named 'Status' and values will be (Active and AutoHold) on the basis of CurrentDate which have compare with 'ActiveDate' which iam using field in my registration form and saving it into database table.

Khargesh RajputPosted Mar 11, 2015, 6:08 AM
set @Status='Active'
else
set @Status='Autohold'
then update status=@status
Azaad AbbasPosted Mar 11, 2015, 5:37 AM
Khargesh RajputPosted Mar 11, 2015, 5:32 AM
Azaad AbbasPosted Mar 11, 2015, 5:24 AM
set @Status='Active'
else
set @Status='Autohold'
before updating ,,then after update it I can retrieve as updated value..
Khargesh RajputPosted Mar 11, 2015, 4:05 AM
Azaad AbbasPosted Mar 11, 2015, 3:54 AM
Azaad AbbasPosted Mar 11, 2015, 3:48 AM
Khargesh RajputPosted Mar 11, 2015, 3:20 AM
Declare @Status varchar(20)
here get Activedate on any variable an compare as
if(Activedate>=getdate())
set @Status='Active'
else
set @Status='Autohold'
and write query to select data for gridview .
here Use Status=@Status