protected void Button1_Click(object sender, EventArgs e) { objBEL = new HostelAllocationBEL(); objDAL = new ClassDAL(); objBEL.course = DropDownList1.SelectedValue; objBEL.branch = DropDownList2.SelectedValue; objBEL.year = DropDownList3.SelectedValue; objBEL.date = TextBox1.Text; objBEL.name = DropDownList6.SelectedValue; objBEL.roomNo = Int32.Parse(DropDownList5.Text.ToString()); Label5.Text = objDAL.AddHostelAllocation(objBEL); GridView1.DataBind(); }