예제 #1
0
        private void CData()//煦濬蹈桶堂隅
        {
            DBConn myDB = new DBConn();
            string sql  = "select * from Category";

            CRepeater.DataSource = myDB.getDataReader(sql);
            CRepeater.DataBind();
            myDB.Close();
        }
예제 #2
0
        private void BindStaff()
        {
            SqlConnection con = DB_helper.GetConnection();

            con.Open();
            String     cquery    = "SELECT * FROM Staff";
            SqlCommand ccmd      = new SqlCommand(cquery, con);
            DataTable  dataTable = new DataTable();

            CRepeater.DataSource = ccmd.ExecuteReader();
            CRepeater.DataBind();
            con.Close();
        }
예제 #3
0
        private void BindShipment()
        {
            SqlConnection con = DB_helper.GetConnection();

            con.Open();
            String     cquery    = "SELECT * FROM Shipment WHERE customerID = '" + uid + "'";
            SqlCommand ccmd      = new SqlCommand(cquery, con);
            DataTable  dataTable = new DataTable();

            CRepeater.DataSource = ccmd.ExecuteReader();
            CRepeater.DataBind();
            con.Close();
        }
예제 #4
0
        private void BindShipment(String portID)
        {
            SqlConnection con = DB_helper.GetConnection();

            con.Open();
            String     query  = "SELECT * FROM Shipment, Port WHERE pid = depPID AND arPID = '" + portID + "' AND statusAP = 'Approved' AND statusAR != 'Delivered'";
            String     cquery = "SELECT * FROM Shipment, Port WHERE pid = arPID AND depPID = '" + portID + "' AND statusAP != 'Approved'";
            SqlCommand ccmd   = new SqlCommand(cquery, con);

            CRepeater.DataSource = ccmd.ExecuteReader();
            CRepeater.DataBind();
            con.Close();

            SqlConnection con2 = DB_helper.GetConnection();

            con2.Open();
            SqlCommand ccmd2 = new SqlCommand(query, con2);

            CRepeater2.DataSource = ccmd2.ExecuteReader();
            CRepeater2.DataBind();
            con.Close();
        }