I am trying to insert values of checkboxlist into transaction table but it's showing me error that
InCorrect Syntax Near '='.
if (cblAmenity.SelectedIndex >= 0)
{
for (int i = 0; i < cblAmenity.Items.Count; i++)
{
if (cblAmenity.Items[i].Selected)
{
ds = obj.sel("Select MAX(PropertyId) AS PrptId from tblPropertyMaster");
string a = ds.Tables[0].Rows[0]["PrptId"].ToString();
string nature = "Sell";
obj.insert("insert into tblAmenityToPropertyTransaction Values (AmenityName=" + i + " , PropertyId=" + a + " , Nature='" + nature + "')");
}
}
}
Any help appreciated.