Пример #1
0
        public void AddV(Violations c)
        {
            OleDbConnection con = new OleDbConnection(Connstring);
            OleDbCommand    cmd = con.CreateCommand();

            con.Open();
            cmd.CommandText = "INSERT INTO Violationlog(Description, violationID, v_date, resolved, dept_id, rating) VALUES(@Description, @violationID, @v_date, @resolved, @dept_id, @rating)";
            cmd.Connection  = con;

            cmd.Parameters.AddWithValue("@Description", c.Description);
            cmd.Parameters.AddWithValue("@violationID", c.ViolationID);
            cmd.Parameters.AddWithValue("@v_date", c.Vdate);
            cmd.Parameters.AddWithValue("@resolved", c.Resolved);
            cmd.Parameters.AddWithValue("@dept_id", c.DeptID);
            cmd.Parameters.AddWithValue("@rating", c.Rating);

            cmd.ExecuteNonQuery();
            con.Close();
        }