Anyone knows to retrieve checkboxlist from database that has char value " , " and single value ?
Object not set to reference - if (PortItem.Users.ToString() != null)
if (PortItem.Users.ToString() != null)
{
char[] spl = new char[] { ' , ' };
string var = dsPort.Tables["Ports"].Rows[0]["Users"].ToString();
string[] arr = var.ToString().Split(spl);for (int i = 0; i < arr.Length; i++)
{
if (arr[i].ToString() != "")
{
ch_Users2.Items.FindByText(arr[i].ToString()).Selected = true;
}
}
}