foreach (Control ctrl in form1.Controls) { if (ctrl is TextBox) { //here you can store the value of textbox string StoreValueToDB = ((TextBox)ctrl).Text; } if (ctrl is DropDownList) { //here you can store the value of textbox string StoreValueToDB = ((DropDownList)ctrl).SelectedValue; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)