Posted on: 10/29/2013 3:01:15 AM | Views : 239

public partial class Survey : System.Web.UI.Page { public DataTable fillmydropdownlist() { SqlConnection con = new SqlConnection(); try { DataTable drpdt = new DataTable(); con.ConnectionString = ConfigurationManager.ConnectionStrings["SurveyFdDBConnString"].ConnectionString; con.Open(); string q = "SELECT SurveyName FROM [Survey]"; SqlCommand cmd = new SqlCommand(q, con); SqlDataAdapter da2 = new SqlDataAdapter(cmd); return drpdt; } catch (Exception ex) { throw ex; } finally { con.Close(); } } protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = fillmydropdownlist(); if (dt.Rows.Count > 0) { DropDownList1.DataSource = dt; DropDown ...

Go to the complete details ...