protected void btnSubmit2_Click(object sender, EventArgs e) { string strCityText2 = txtCityText2.Text.Replace(Environment.NewLine, "<br />"); DBConnection obj = new DBConnection(); DataTable dt = VADBCommander.CityTextByCountyInd(countyID.ToString()); try { if (dt.Rows.Count > 0) { VADBCommander.CityText2ByCountyEdit(countyID.ToString(), strCityText2); } else { VADBCommander.CityText2ByCountyAdd(countyID.ToString(), strCityText2); } lblInfo2.Text = "Data saved."; } catch (Exception ex) { lblInfo2.Text = ex.Message; } lblInfo2.ForeColor = System.Drawing.Color.Red; }