ASP.NET 2.0 BasicsIf you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
My Business Logic Layer generates an error due to NULL values in the Title's column.
Public Property Title() As String
Get
Return m_Title
End Get
Set(ByVal value As String)
If (value Is System.DBNull.Value)Then
m_Title = "No Title Indicated"<---Error
Else
m_Title = value
End If
End Set
End Property
The output is sent to the gridview control.
How to get around having NULL values as the entire db will not be populated at all times.
SELECT
ISNULL(<column>, <value to use>) as [name]
From Table
If a null value if found in the column, it will be replaced with the value specified as the second parameter.
================================================== =========
Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET http://www.wiley.com/WileyCDA/WileyT...470131470.html
Then you didnt change your sql statement correctly.
If i do SELECT IsNull(column, '') as [name] from table
If that column contains a NULL value, my select statement will return an empty string, not a NULL DbType.
================================================== =========
Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET http://www.wiley.com/WileyCDA/WileyT...470131470.html