Click here to Skip to main content
15,890,123 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need help with Image Pin
jaygalway211620-Jun-10 18:44
jaygalway211620-Jun-10 18:44 
GeneralRe: Need help with Image Pin
Luc Pattyn20-Jun-10 19:04
sitebuilderLuc Pattyn20-Jun-10 19:04 
QuestionVisStudio (VB.Net) 2005 to 2008/2010 - Errors just returning from functions Pin
QuickBooksDev19-Jun-10 1:19
QuickBooksDev19-Jun-10 1:19 
AnswerRe: VisStudio (VB.Net) 2005 to 2008/2010 - Errors just returning from functions Pin
AnnieMacD19-Jun-10 1:26
AnnieMacD19-Jun-10 1:26 
AnswerRe: VisStudio (VB.Net) 2005 to 2008/2010 - Errors just returning from functions Pin
Luc Pattyn19-Jun-10 1:58
sitebuilderLuc Pattyn19-Jun-10 1:58 
AnswerRe: VisStudio (VB.Net) 2005 to 2008/2010 - Errors just returning from functions Pin
DaveAuld19-Jun-10 4:38
professionalDaveAuld19-Jun-10 4:38 
QuestionCoalesce -- Any suggestions on how to improve this? Pin
Gregory Gadow18-Jun-10 8:08
Gregory Gadow18-Jun-10 8:08 
AnswerRe: Coalesce -- Any suggestions on how to improve this? Pin
rhuiden18-Jun-10 10:26
rhuiden18-Jun-10 10:26 
I wrote an extension method for this not too long ago.
<System.Runtime.CompilerServices.Extension()> _
	Public Function GetColumnAsString(ByVal rdr As System.Data.IDataReader, ByVal columnName As String, Optional ByVal valueIfNull As String = "") As String
		Dim obj As Object

		If rdr Is Nothing Then
			Return valueIfNull
		Else
			obj = rdr(columnName)
			If obj IsNot Nothing AndAlso obj.Equals(DBNull.Value) = False Then
				Return obj.ToString()
			Else
				Return valueIfNull
			End If
		End If
	End Function


Note: it does not check for make sure the column specified exists.

Using your example it would be
Response.Write(DR.GetColumnAsString("TerminatedDate", "%nbsp;"))


You could also embed it for more of a coalesce functionality.

Response.Write(DR.GetColumnAsString("TerminatedDate", DR.GetColumnAsString("SomeOtherDate", "%nbsp;"))

QuestionSingle Sign on Pin
berba18-Jun-10 2:59
berba18-Jun-10 2:59 
AnswerRe: Single Sign on Pin
Dave Kreskowiak18-Jun-10 8:06
mveDave Kreskowiak18-Jun-10 8:06 
GeneralRe: Single Sign on Pin
berba22-Jun-10 23:15
berba22-Jun-10 23:15 
GeneralRe: Single Sign on Pin
Dave Kreskowiak23-Jun-10 1:33
mveDave Kreskowiak23-Jun-10 1:33 
QuestionPowerPoint Application Pin
rdop18-Jun-10 1:13
rdop18-Jun-10 1:13 
AnswerRe: PowerPoint Application Pin
ddecoy18-Jun-10 1:16
ddecoy18-Jun-10 1:16 
GeneralRe: PowerPoint Application Pin
rdop18-Jun-10 1:36
rdop18-Jun-10 1:36 
GeneralRe: PowerPoint Application Pin
JR21218-Jun-10 2:13
JR21218-Jun-10 2:13 
GeneralRe: PowerPoint Application Pin
EliottA18-Jun-10 2:27
EliottA18-Jun-10 2:27 
GeneralRe: PowerPoint Application Pin
JR21218-Jun-10 20:38
JR21218-Jun-10 20:38 
GeneralRe: PowerPoint Application [modified] Pin
MsmVc18-Jun-10 2:31
MsmVc18-Jun-10 2:31 
GeneralRe: PowerPoint Application Pin
EliottA18-Jun-10 2:33
EliottA18-Jun-10 2:33 
GeneralRe: PowerPoint Application [modified] Pin
MsmVc18-Jun-10 2:42
MsmVc18-Jun-10 2:42 
GeneralRe: PowerPoint Application Pin
JR21221-Jun-10 3:36
JR21221-Jun-10 3:36 
Questionnewbie question on updating Access mdb tables Pin
john12617-Jun-10 5:46
john12617-Jun-10 5:46 
QuestionRe: newbie question on updating Access mdb tables Pin
DaveAuld17-Jun-10 6:26
professionalDaveAuld17-Jun-10 6:26 
QuestionRe: newbie question on updating Access mdb tables Pin
john12617-Jun-10 6:36
john12617-Jun-10 6:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.