Beispiel #1
0
        public void getColumns()//----------------------------------------------------------Get columns from ibt columns table to dropdownlist (DDLRules)-----------------//
        {
            try
            {
                OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ORAWF"].ToString());
                conn.Open();
                OracleCommand cmd = conn.CreateCommand();//IBT Accounts
                cmd.CommandText = "select t.ID,t.Description from fas_ibt_columns t where t.Inactive = 0 and t.id <> 15";
                OracleDataAdapter oda = new OracleDataAdapter(cmd);
                DataTable         dt  = new DataTable();
                oda.Fill(dt);

                DDLRules.DataTextField  = "Description";
                DDLRules.DataValueField = "ID";
                DDLRules.DataSource     = dt;
                DDLRules.DataBind();

                DDLRules.Items.Insert(0, new ListItem("---Please Select---", "0"));
            }
            catch (Exception ex)
            {
                CommonCLS.CommonFunctions.Logger(System.Web.VirtualPathUtility.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.InnerException.ToString(), Server.MapPath("~/IBTLogFiles/Log.txt"));
                //call_error_msg(false);
                lblResult.Text = ex.InnerException.ToString();
            }
        }
        private void LoadColumns()
        {
            try
            {
                //this.GrdRules.Rows[0].Cell[0].value = 1;

                //lblResult.Text = "";

                //GrdRules.DataSource = null;
                //GrdRules.DataBind();

                //OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ORAWF"].ToString());
                //OracleCommand cmd = new OracleCommand();
                //conn.Open();
                //cmd.Connection = conn;

                //cmd.CommandText = "select t.ID,t.Description from fas_ibt_columns t where t.ID =1";

                //OracleDataReader myOleDbDataReader = cmd.ExecuteReader();
                //if (myOleDbDataReader.HasRows == true)
                //{
                //    GrdRules.DataSource = myOleDbDataReader;
                //    GrdRules.DataBind();
                //}

                //conn.Close();
                //myOleDbDataReader.Close();

                OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["ORAWF"].ToString());
                conn.Open();
                OracleCommand cmd = conn.CreateCommand();//IBT Accounts
                cmd.CommandText = "select t.ID,t.Description from fas_ibt_columns t where t.Inactive = 0";
                OracleDataAdapter oda = new OracleDataAdapter(cmd);
                DataTable         dt  = new DataTable();
                oda.Fill(dt);

                DDLRules.DataTextField  = "Description";
                DDLRules.DataValueField = "ID";
                DDLRules.DataSource     = dt;
                DDLRules.DataBind();

                DDLRules.Items.Insert(0, new ListItem("---Please Select---", "0"));
            }
            catch (Exception ex)
            {
                CommonCLS.CommonFunctions.Logger(System.Web.VirtualPathUtility.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.InnerException.ToString(), Server.MapPath("~/IBTLogFiles/Log.txt"));
                call_error_msg(false);
                lblResult.Text = ex.InnerException.ToString();
            }
        }