נשלח בתאריך: 28 November 2007 בשעה 16:28 | | IP רשוּם
|
|
|
|
Dim Conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & My.Application.Info.DirectoryPath & "\db9.mdb") Dim cmd As New OleDbCommand() Dim cmd1 As New OleDbCommand() Dim cmd2 As New OleDbCommand() Dim Reader1 As OleDbDataReader Dim Reader2 As OleDbDataReader
Conn.Open() cmd1.Connection = Conn cmd1.CommandText = "Select * from ayczor1 Where [day] = " & Me.day_arc
Reader1 = cmd1.ExecuteReader
cmd.Connection = Conn cmd2.Connection = Conn While Reader1.Read cmd2.CommandText = "select * from tbl_client where id_client = " & Reader1.GetInt32(1) Reader2 = cmd2.ExecuteReader While Reader2.Read cmd.CommandText = "Insert INTO arc ([id_client], [id_driver], [date] , [name_client] ) Values ( @id_client, @driver, @date, @name_client)" cmd.Parameters.AddWithValue("@id_client", Reader1.GetInt32(1)) cmd.Parameters.AddWithValue("@driver", Reader1.GetInt32(0)) cmd.Parameters.AddWithValue("@date", Me.date_arc.Date) cmd.Parameters.AddWithValue("@name_client", Reader2.GetString(1)) cmd.ExecuteNonQuery() cmd.Parameters.Clear() End While
End While Conn.Close() MsgBox("הסתיים") Me.ArcTableAdapter.date_q(Me.Arc_set.arc, Me.date_arc)
איך אני יכול לעשות ששתי reader יעבדו בו זמנית
|