public void saveMinistry() { SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); conn.ConnectionString = "Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike"; string StrQuery; foreach (var checkedItem in this.cblMinistries.CheckedItems) { SqlCommand comm = new SqlCommand(); comm.Connection = conn; StrQuery = @"INSERT INTO tblMembershipministry VALUES ('" + this.txtMembershipid2.Text + "', '" + checkedItem + "')"; comm.CommandText = StrQuery; conn.Open(); comm.ExecuteNonQuery(); conn.Close(); } //MessageBox.Show("Record was successfully Added"); }
public void searchMinistry10() { SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); conn.ConnectionString = "Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike"; string StrQuery; foreach (var checkedItem in this.cblMinistries.CheckedItems) { SqlCommand comm = new SqlCommand(); comm.Connection = conn; StrQuery = @"SELECT * FROM tblMembershipministry WHERE FormattedMembershipid = '" + this.txtMembershipid2.Text + "'"; comm.CommandText = StrQuery; conn.Open(); comm.ExecuteNonQuery(); conn.Close(); } //MessageBox.Show("Record was successfully Added"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)