Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 10:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default 'NVL' type function

Does .NET have an NVL type function. Example:

nvl(variablename, "0")

If variablename doesn't contain a value it gets 0.

 
Old November 22nd, 2004, 12:19 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is variablename a value returned from a SQL Server database?

If so you can use the function IsNULL(value,replacement value)

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old November 22nd, 2004, 12:26 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also, you can test variablename for NULL, such as:

If variablename is System.DBNull.value Then
  variablename = 0
End If

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old November 22nd, 2004, 12:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

It's going into the SQL Server DB. I ended up setting the Default = Null in the stored procedure and it now works.

The problem was that I have a form with 24 possible fields but it's built dynamically based on your search so not all 24 fields are going to be present and thus Null values are coming in when I tried to update the DB. It would give "certain_field does not contain a value" error.






Similar Threads
Thread Thread Starter Forum Replies Last Post
NVL(var1,var2) ramanadyv SQL Language 1 March 23rd, 2006 07:21 AM
Using a user defined type and the Split Function nikotromus Access VBA 2 August 20th, 2004 12:02 PM
Split Function type mismatch error nikotromus Access VBA 4 August 19th, 2004 12:46 PM
Dlookup function giving Type Mismatch error Ron V Access 2 May 19th, 2004 01:31 PM
Have any function to check the integer type only calvinpost ASP.NET 1.x and 2.0 Application Design 2 April 1st, 2004 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.