Friday, August 23, 2013

how to check for IsDBNull when assiging a value from dataset or datatable to a control

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"))

No comments:

Post a Comment