protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["Std_Id"] != null) { Std_Id.Text = Request.QueryString["Std_Id"].ToString().Trim(); } else { Response.Redirect("~/Student"); } prepareDepartment(); DepList.DataSource = depSet; DepList.DataBind(); prepareReligion(); ReligionList.DataSource = ReligionSet; ReligionList.DataBind(); prepareClub(); ClubList.DataSource = clubSet; ClubList.DataBind(); Std_Id_Old.Value = Std_Id.Text; getDetail(); } //for (int idx = 0; idx < mySet.Rows.Count; idx++) // Response.Write(mySet.Rows[idx]["std_id"].ToString() + "-" + mySet.Rows[idx]["std_name"].ToString() + "<hr>"); }
/// <summary> /// To Load Religion Data /// </summary> /// <returns></returns> public ReligionList LoadReligionData() { cnn = new OracleConnection(AppConfiguration.ConnectionString); string proc = "USP_MST_GET_RELIGION"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); ReligionBO obMaster = null; ReligionList Master = new ReligionList(); while (dr.Read()) { obMaster = new ReligionBO(); if (!dr.IsDBNull(dr.GetOrdinal("ID"))) { obMaster.ReligionID = dr.GetInt32(dr.GetOrdinal("ID")); } if (!dr.IsDBNull(dr.GetOrdinal("Name"))) { obMaster.ReligionName = dr.GetString(dr.GetOrdinal("Name")); } Master.Add(obMaster); } dr.Close(); return(Master); }
void prepareReligion() { string sqlstr = "select rel_id, rel_name from religion order by rel_id"; ReligionSet = mydb.GetDataTable(sqlstr); ReligionList.DataSource = ReligionSet; ReligionList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { prepareDepartment(); DepList.DataSource = depSet; DepList.DataBind(); prepareReligion(); ReligionList.DataSource = ReligionSet; ReligionList.DataBind(); prepareClub(); ClubList.DataSource = clubSet; ClubList.DataBind(); } //for (int idx = 0; idx < mySet.Rows.Count; idx++) // Response.Write(mySet.Rows[idx]["std_id"].ToString() + "-" + mySet.Rows[idx]["std_name"].ToString() + "<hr>"); }