protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { } if ( Request.QueryString.Count > 0) { Loaddata(); } } protected void Loaddata() { SqlConnection con = new SqlConnection("Data Source=jayraj-pc\\sqlexpress;Initial Catalog=Internship;Integrated Security=True;Pooling=False"); SqlCommand cmd3 = new SqlCommand("select * from Internship where InternshipID=" + Convert.ToInt16(Request.QueryString["InternshipID"].ToString()), con); SqlDataAdapter daa = new SqlDataAdapter(cmd3); DataTable dtt = new DataTable(); daa.Fill(dtt); if (dtt.Rows.Count > 0) { title.Text = dtt.Rows[0]["Title"].ToString(); role.Text = dtt.Rows[0]["InternshipRole"].ToString(); noofopenings.Text = dtt.Rows[0]["NoOfOpenings"].ToString(); startdate.Text = dtt.Rows[0]["InternshipStartDate"].ToString(); enddate.Text = dtt.Rows[0]["ApplicationDeadLine"].ToString(); duration.Text = dtt.Rows[0]["Duration"].ToString(); type.SelectedItem.Text = dtt.Rows[0]["Type"].ToString(); DropDownList2.SelectedItem.Text = dtt.Rows[0]["InternshipCity"].ToString(); DropDownList3.SelectedItem.Text = dtt.Rows[0]["Degree"].ToString(); //Response.Write(dtt.Rows[0]["Degree"].ToString()); DropDownList4.SelectedItem.Text = dtt.Rows[0]["Branch"].ToString(); Response.Write(dtt.Rows[0]["Branch"].ToString()); int_address.Text = dtt.Rows[0]["Address"].ToString(); int_contactno.Text = dtt.Rows[0]["ContactNo"].ToString(); RadioButtonList1.Items.FindByText(dtt.Rows[0]["Stipend"].ToString()).Selected = true; RadioButtonList2.Items.FindByText(dtt.Rows[0]["FullTimeJob"].ToString()).Selected = true; skills_req.Text = dtt.Rows[0]["SkillsRequired"].ToString(); } }
if (dtt.Rows.Count > 0) { DropDownList4.SelectedItem.Text = Convert.ToString(dtt.Rows[0]["Branch"]); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)