using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Data.OleDb; public partial class Forms_Master_Forms_Temporary_duty_form : System.Web.UI.Page { SqlConnection conn = new SqlConnection("Server=SOFTDEV1; Database=ADE_2903_SOFTDEV; Integrated security = true"); protected void Page_Load(object sender, EventArgs e) { DropDownList7.Visible = false; if (!IsPostBack) { GetData(); txtdate.Text = DateTime.Now.ToShortDateString();//get the current date into the textbox //adding the states in the drop down box add_states(); } } protected void GetData() { SqlCommand cmd = new SqlCommand("select * from M_Division ", conn); SqlDataAdapter sd = new SqlDataAdapter(cmd); conn.Open(); DataTable dt = new DataTable(); sd.Fill(dt); DropDownList3.DataSource = dt; DropDownList3.DataTextField = "DivShort"; DropDownList3.DataValueField = "DivShort"; DropDownList3.DataBind(); conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)