Forum guidelines
  • Home
  • »
  • Windows Azure
  • »
  • Then how to assign and read the the Null value in Session variable
AuthorQuestion
Then how to assign and read the the Null value in Session variable
Posted on: 07 Dec 2011
I want to read a DB data and put into session and then need to read the session value and insert into another Table..

Issue i am facing here is

First time wen reading value frm DB ., if any fields contains NULL ., then how to assign and read the the Null value in Session variable 




AuthorReply
Re: Then how to assign and read the the Null value in Session variable
Posted on: 02 Jan 2012  
Hi,

use IsDBNull when retrive from database and set initial value.

In vb

if(IsDBNull(dr(0)))
       Session("test") = 0;
end

in C#

if(string.IsNullOrEmpty(StringValue))

{

Session["test"] = 0;

}

hope this help..



SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.