private void PopulateMinistires() { SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); conn.ConnectionString = "Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike"; using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "select * from tblMinistries"; cmd.Connection = conn; conn.Open(); using (SqlDataReader sdr = cmd.ExecuteReader()) { while (sdr.Read()) { ListItem item = new ListItem(); item.Text = sdr["Homecellname"].ToString(); chkMinistries.Items.Add(item); } } conn.Close(); } }
using System.Web.UI.WebControls;
using System.Windows.Forms;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)