To check for IsDBNull value before assigning a value to the control
lblCagt.Text = IIf(IsDBNull(dsAgent.Tables(0).Rows(0)("CompanyName")), "", dsAgent.Tables(0).Rows(0)("CompanyName"))
lblCagt.Text = IIf(IsDBNull(dsAgent.Tables(0).Rows(0)("CompanyName")), "", dsAgent.Tables(0).Rows(0)("CompanyName"))
No comments:
Post a Comment