John Bingham

John Bingham

  • NA
  • 4
  • 672

visual foxpro to visual studio c#

Dec 10 2020 11:03 PM
I had the following in a visual foxpro project click event that i am trying to redo in a visual studio c# click event
it used a foxpro database training.dbc with the tables d_training, departments, e_training, employee.
 I converted the database to access.accdb and trying to use oleDbConnection to connect to the data and i need to convert this click event to use on the new windows form. can someone help??
 
 
 
SELECT 0
SELECT departments
GOTO TOP
DO WHILE .NOT.EOF()
SELECT d_training.form_num, ".NULL." AS trained, ".NULL." AS eid, ".NULL." AS first, ".NULL." AS last
FROM TRAINING1!D_training
WHERE(d_training.dept = "All_Departments" OR d_training.dept = departments.dept)
ORDER BY d_training.form_num
INTO CURSOR Reqtrain
SELECT e_training.number AS trained, e_training.eid, e_training.first, e_training.last
FROM TRAINING1!E_training
WHERE e_training.eid = thisform.e_id1.value
INTO CURSOR Trained
SELECT reqtrain.form_num, trained.trained, trained.eid, trained.first, trained.last
FROM Reqtrain
LEFT JOIN Trained ON reqtrain.form_num = trained.trained
ORDER BY reqtrain.form_num
INTO CURSOR approval
SELECT approval
is_trained = .T.
IF EOF()
is_trained = .F.
ELSE
DO WHILE.NOT.EOF()
IF ISNULL(trained)
is_trained = .F.
EXIT
ENDIF
SKIP
ENDDO
ENDIF
SELECT employee
SET ORDER TO e_id
GOTO TOP
SEEK TRIM(thisform.e_id1.value)
IF FOUND()
m.dep = departments.numb
REPLACE & dep WITH is_trained
ENDIF
SELECT departments
SKIP
ENDDO
thisform.refresh()
thisform.qualify.enabled = .F.