using System; using System.Collections.Generic; using System.Data; using System.Data.Odbc; using System.Data.OleDb; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class JavaStop_InquiryForm : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Database Connection OleDbConnection conn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = e:\\ectserver\\blue50\\Database\\JavaStop_Content.mdb"); OleDbDataReader dataReader; ListItem itemBlank = new ListItem(); itemBlank.Text = ""; itemBlank.Value = ""; //Set Business Type Drop Down List ddBusinessType.Items.Add(itemBlank); OleDbCommand btCmd = new OleDbCommand("Select * FROM BusinessType", conn); conn.Open(); dataReader = btCmd.ExecuteReader(); while(dataReader.Read()) { ListItem item = new ListItem(); item.Text = dataReader["BusinessType"].ToString(); item.Value = dataReader["BusinessType_ID"].ToString(); ddBusinessType.Items.Add(item); } conn.Close(); //Set Business Type Drop Down List ddInquiryType.Items.Add(itemBlank); OleDbCommand itCmd = new OleDbCommand("Select * FROM InquiryType", conn); conn.Open(); dataReader = itCmd.ExecuteReader(); while (dataReader.Read()) { ListItem item = new ListItem(); item.Text = dataReader["InquiryName"].ToString(); item.Value = dataReader["InquiryType_ID"].ToString(); ddInquiryType.Items.Add(item); } conn.Close(); } }