Posted on: 6/30/2015 5:48:48 PM | Views : 791

Hi ,
In my application I have checkboxlists.If I don't check  anything in checkboxlist and click on  save button . when I debug the code  ,Its not storing any data  in database it is throwing the error
Object reference not set to an instance of an object string name3 = string.Empty; foreach (ListItem item1 in this.chkmin.Items) { if (item1.Selected) { name3 += item1 + ","; } } if (chkmin.SelectedItem.Text != "") { Cmd.Parameters.AddWithValue("@WomenOwn1", name3); } else { Cmd.Parameters.AddWithValue("@WomenOwn1", DBNull.Value); }

Go to the complete details ...