Private Sub insertStaffArray3()
Dim adapter As OleDbDataAdapter
Dim arrayCommand As OleDbCommand
Dim job As String = Me.prjName.Text.ToString
Dim JobId As String = Me.projId.Text.ToString
Dim strstaff1 As String = Me.staff1.Text.ToString
Dim strstaff2 As String = Me.staff2.Text.ToString
Dim strhrs1 As String = Me.hrs1.Text.ToString
Dim strhrs2 As String = Me.hrs2.Text.ToString
Dim arrayJob() As String = {job, job}
Dim arrayJobId() As String = {JobId, JobId}
Dim arrayStaff() As String = {strstaff1, strstaff2}
Dim arrayHrs() As String = {strhrs1, strhrs2}
adapter = New OleDbDataAdapter("SELECT jobDescription,jobId,employeeName,scheduledTime FROM ScheduledTime", OleDbConnection1)
arrayCommand = New OleDbCommand("Insert into ScheduledTime(jobDescription,jobId,employeeName,scheduledTime) values(?,?,?,?)", OleDbConnection1)
'arrayCommand.Parameters
arrayCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("jobDescription", System.Data.OleDb.OleDbType.VarWChar, 50, "jobDescription"))
arrayCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("jobId", System.Data.OleDb.OleDbType.VarWChar, 50, "jobId"))
arrayCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("employeeName", System.Data.OleDb.OleDbType.VarWChar, 50, "employeeName"))
arrayCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("scheduledTime", System.Data.OleDb.OleDbType.Double, 0, "scheduledTime"))
arrayCommand.Parameters("jobDescription").Value = arrayJob
arrayCommand.Parameters("jobId").Value = arrayJobId
arrayCommand.Parameters("employeeName").Value = arrayStaff
arrayCommand.Parameters("scheduledTime").Value = arrayHrs
Try
Me.OleDbConnection1.Open()
arrayCommand.ExecuteNonQuery()
Catch ex As OleDbException
MessageBox.Show(ex.Message)
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Me.OleDbConnection1.Close()
End Try
End Sub