コード例 #1
0
 void BindOperators()
 {
     try
     {
         ClsBAL obj = new ClsBAL();
         DataSet ds = obj.GetBusOperators();
         if (ds != null & ds.Tables[0].Rows.Count > 0)
         {
             gvOperators.DataSource = ds.Tables[0];
         }
         else
         {
             gvOperators.DataSource = null;
         }
         Session["Operators"] = ds.Tables[0];
         gvOperators.DataBind();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
    protected void GetBusOpeartors()
    {
        try
        {
            objBAL = new ClsBAL();
            ObjDataset = (DataSet)objBAL.GetBusOperators();
            if (ObjDataset != null)
            {
                if (ObjDataset.Tables.Count > 0)
                {
                    ddlOperator.DataSource = ObjDataset.Tables[0];
                    ddlOperator.DataValueField = "BusOperatorId";
                    ddlOperator.DataTextField = "BusOperatorName";
                    ddlOperator.DataBind();
                    ddlOperator.Items.Insert(0, "Select");
                }
            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }