Ejemplo n.º 1
0
        public static DataRowCollection getLoadsDetails(string ACCNO)
        {
            Config c = new Config();
            SqlConnection con;

            if(c.Database.IS_BUILTIN)
                con = new SqlConnection(String.Format("database={0};server={1};integrated security={2}",c.Database.DB,c.Database.HOST,c.Database.IntegratedSecurity));
            else
                con = new SqlConnection(String.Format("database={0};server={1};UID={2};pwd={3};", c.Database.DB, c.Database.HOST, c.Database.UID,c.Database.PWD));

            using (con)
            {
                con.Open();
                string sql = string.Format(@"select CORTEXDATE,CRDPRODUCT,PROGRAMID,ACCTYPE,DESCRIPTION,AMTBILL
            from View_Kite_LoadReport_ACCNO
            where ACCNO='{0}'
            order by CORTEXDATE,CRDPRODUCT,PROGRAMID,ACCTYPE", ACCNO);

                //Console.WriteLine(sql);
                //Console.ReadLine();

                SqlDataAdapter adp = new SqlDataAdapter(sql, con);
                DataSet dst = new DataSet();
                adp.Fill(dst, "LOADS");
                return dst.Tables["LOADS"].Rows;
            }
        }
Ejemplo n.º 2
0
        public Program()
        {
            try{
            this.c = new Config();
            }catch(FileNotFoundException f){
                Console.WriteLine(f.Message);
                Console.ReadLine();
            }
            if(c.Database.IS_BUILTIN)
                this.con = new SqlConnection(String.Format("database={0};server={1};integrated security={2}",this.c.Database.DB,this.c.Database.HOST,this.c.Database.IntegratedSecurity));
            else
                this.con = new SqlConnection(String.Format("database={0};server={1};UID={2};pwd={3};", this.c.Database.DB, this.c.Database.HOST, this.c.Database.UID,this.c.Database.PWD));

            this.con.Open();
        }