while using the given below code showing one error. The error is : Operator '<>' is not defined for type 'DBNull' and string "". Help me to find a proper solution. Thank You.
Code:
If sdr1.Read Then
If sdr1(1) <> "" Then
NameLabel.Text = sdr1(0).ToString + " " + sdr1(1).ToString + " " + sdr1(2).ToString
Else
NameLabel.Text = sdr1(0).ToString + " " + sdr1(2).ToString
End If
dept_id.Text = sdr1(3)
End If
sdr1.Close()
&is the string concatenation operator, not+.