protected void ddlPayee_SelectedIndexChanged(object sender, EventArgs e) { if (ddlPayee.SelectedItem.Value != "0") { SqlDataReader sdr = uc.GetNameroomNo(ddlPayee.SelectedItem.Value); if (sdr.HasRows) { if (sdr.Read()) { string RoomNo = sdr["t_RoomNo"].ToString(); string Mobile = sdr["t_MobileNo"].ToString(); Session["t_MobileNo"] = sdr["t_MobileNo"].ToString(); txtRoomNoMobile.Text = RoomNo + " (" + Mobile + ")"; Session["t_RoomNo"] = sdr["t_RoomNo"].ToString(); ddlDuesType.SelectedItem.Text = "Room Rent"; ddlDuesType.SelectedItem.Value = "1"; txtDuesAmount.Text = sdr["t_RentMoney"].ToString(); DateTime DateNow = System.DateTime.Now; txtDuesDate.Text = DateNow.ToString("yyyy-MM-dd"); txtDuesMonth.Text = DateNow.ToString("yyyy-MM"); } } sdr.Close(); } }