code:if Else condition for status in asp.net using sql server

Posted by Dn2010 under ASP.NET on 1/30/2011 | Points: 10 | Views : 2603 | Status : [Member] | Replies : 1
hi friends,
how to create if condition , status 1 is active ,0 is DeActive.

details visible from database in gridview

for example,

if consider status is 1 from database,

display that item ,otherwise not display.

how to create in page_load,

the coding in if....Else for status.

please give the code for it.

thanks.




Responses

Posted by: Karthikanbarasan on: 1/30/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi Dn2010,

Once u get the value from dataset say that value is in variable intstatus then your code should be

if (intstatus == 1)
{
Console.WriteLine("One");
}
else
{
Console.WriteLine("Zero");
}


Thanks
Karthik
www.f5Debug.net

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response