Hi All,
I have a simple problem that has made me pondering for days on Google and still have no answer:
For example, I have following SQL query:
SELECT
ID, AccountNum, Name
FROM
Table1
WHERE
AccountNum = @AccountNum
Name = @Name
(In which @AccountNum and @Name are session variable).
Then in the C# code behind. I wrote:
Session["AccountNum"] = DBNull.Value;
Session["Name"] = DBNull.Value;
Logically, It would return for me a list of row in which both AccountNum and Name are NULL value. However, it didn't work. It's only work if both Name and AccountNum are varchar datatype in database (But in this case, AccountNum is a Int32 datatype).
Please let me know if any of you know any work around.
Thanks All
Lamk.
I have a simple problem that has made me pondering for days on Google and still have no answer:
For example, I have following SQL query:
SELECT
ID, AccountNum, Name
FROM
Table1
WHERE
AccountNum = @AccountNum
Name = @Name
(In which @AccountNum and @Name are session variable).
Then in the C# code behind. I wrote:
Session["AccountNum"] = DBNull.Value;
Session["Name"] = DBNull.Value;
Logically, It would return for me a list of row in which both AccountNum and Name are NULL value. However, it didn't work. It's only work if both Name and AccountNum are varchar datatype in database (But in this case, AccountNum is a Int32 datatype).
Please let me know if any of you know any work around.
Thanks All
Lamk.