I have a form that is doing a simple insert, then a sub insert of a certain drop down selection is made. What i dont get is why the main insert is inserting duplicates and the sub works fine inserting 1 record per text as expected. I click the button 1 time, and when i check the table, there are 2 new records.. As you can see the insert is not wrapped with any conditions, once that is inserted i check if a slection was made and runs the sub insert.
My full code can be found in this post(http://forums.asp.net/t/1608619.aspx), but here is what i have for my button event.
protected void btnSaveServConfig_Click(object sender, EventArgs e)
dac.insertServerConfigintosql(txtEmailLogin, txtEmailPass, Convert.ToInt32(ddlNumEmail.SelectedValue));
if (Convert.ToInt32(ddlNumEmail.SelectedValue) > 0)
Dictionary<string, string> camValues = new Dictionary<string, string>();
foreach (HtmlTableRow row in table1.Rows)
foreach (HtmlTableCell cell in row.Cells)
foreach (Control control in cell.Controls)
View Complete Post