I am trying to extract a field value from a database table, and if the value is Null, I want to redirect the user to another webpage, but it comes up with the object not found error on the line where it checks if the value is null or not.
Kai-What?
Code:
Dim CmdSelectVerify As OleDbCommand
CmdSelectVerify = New OleDbCommand("Select * From PartSpecs WHERE [Part No_:] = '" & strPID & "'", conMetrics)
Dim myDAVerify As OleDbDataAdapter = New OleDbDataAdapter(CmdSelectVerify)
Dim myDataSetVerify = New DataSet
myDAVerify.Fill(myDataSetVerify, "PartSpecs")
Dim RowVerify As DataRow
If myDataSetVerify.Tables("PartSpecs").Rows.Count > 0 Then
RowVerify = myDataSetVerify.Tables("PartSpecs").Rows(0)
End If
If RowVerify.Item("Part NO_:") Is DBNull.Value Then
Response.Redirect("[URL unfurl="true"]http://....")[/URL]
Else
End If
Kai-What?