I am trying to get value from database that is null, but what is happening that it is comin in as
#1/1/1900# or #12:00:00 AM#
. In the sp the value is defined as Datetime
What I want is that when a value comes and its null then the program should return Nothing.Just blank "".
Here is my Property, method and application view.Please help on how can I get rid of this #1/1/1900# or #12:00:00 AM# or #1/1/190012:00:00 AM#.
--Property
PublicProperty 1Date() AsDate
Get
1Date= _1Date.ToShortDateString
EndGet
Set(ByVal Value AsDate)
_1Date= Value
EndSet
EndProperty
--Methods
PublicFunction Get info()
If Not dr("@1Date") Is DBNull.Value Then
.1Date= (Convert.ToDateTime(dr("@1Date")))
End If
Endfunction
--application
dt = New DataTable
dt.Columns.Add(New DataColumn("1Date", GetType(String)))
Dim dr As DataRow = dt.NewRow()
dr= .1Date.ToShortDateString
#1/1/1900# or #12:00:00 AM#
. In the sp the value is defined as Datetime
What I want is that when a value comes and its null then the program should return Nothing.Just blank "".
Here is my Property, method and application view.Please help on how can I get rid of this #1/1/1900# or #12:00:00 AM# or #1/1/190012:00:00 AM#.
--Property
PublicProperty 1Date() AsDate
Get
1Date= _1Date.ToShortDateString
EndGet
Set(ByVal Value AsDate)
_1Date= Value
EndSet
EndProperty
--Methods
PublicFunction Get info()
If Not dr("@1Date") Is DBNull.Value Then
.1Date= (Convert.ToDateTime(dr("@1Date")))
End If
Endfunction
--application
dt = New DataTable
dt.Columns.Add(New DataColumn("1Date", GetType(String)))
Dim dr As DataRow = dt.NewRow()
dr= .1Date.ToShortDateString