M
Mike OKC
VB 2005
All developers face this issue; so I'm sure Microsoft was a solution for it.
What is the built in method to check DBNull in a recordset field? NOT a
typed dataset.
I don't want to modify my sql script because it is created dynamically.
Below I have the old method to check for DBNull and to deal with DBNull in
the recordset. This method of coding is used over 80 times as I have over 80
fields to check for DBNull, so a one line method call off the value recordset
would be great.
If IsDBNull(rstSQLdetail.Fields("CaseNumber").Value) Then
txtCaseNumber.Text = ""
Else
txtCaseNumber.Text = rstSQLdetail.Fields("CaseNumber").Value
End If
It would be great to have something LIKE this,
txtCaseNumber.Text = rstSQLdetail.Fields("CaseNumber").Value.ChkDBNull("")
In this example the method would return a zero length string.
All developers face this issue; so I'm sure Microsoft was a solution for it.
What is the built in method to check DBNull in a recordset field? NOT a
typed dataset.
I don't want to modify my sql script because it is created dynamically.
Below I have the old method to check for DBNull and to deal with DBNull in
the recordset. This method of coding is used over 80 times as I have over 80
fields to check for DBNull, so a one line method call off the value recordset
would be great.
If IsDBNull(rstSQLdetail.Fields("CaseNumber").Value) Then
txtCaseNumber.Text = ""
Else
txtCaseNumber.Text = rstSQLdetail.Fields("CaseNumber").Value
End If
It would be great to have something LIKE this,
txtCaseNumber.Text = rstSQLdetail.Fields("CaseNumber").Value.ChkDBNull("")
In this example the method would return a zero length string.