Dim dreader As OleDbDataReader = ocm.ExecuteReader() While dreader.Read For Each Name As String In Lstexec.Items If dreader.Read.ToString = Name Then lancerRequete("INSERT INTO Programs VALUES('" & Name.Replace("'", "''") & "')") End If Next End While
If dreader.Read.ToString <> Name Then
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim txtsql As String = "select * from Programs" Dim ocn As New OleDbConnection(sconstr) Dim ocm As New OleDbCommand(txtsql, ocn) ocm.Connection.Open() Dim dta As OleDbDataAdapter = New OleDbDataAdapter(ocm) Dim dreader As OleDbDataReader = ocm.ExecuteReader()
Dim trouvé as boolean = False For Each Name As String In Lstexec.Items Dim dreader As OleDbDataReader = ocm.ExecuteReader() While dreader.Read If dreader(0).ToString = Name Then trouvé = True End If Next End While if NOT Trouvé then lancerRequete("INSERT INTO Programs VALUES(...)") Next
Dim txtsql As String = "select * from Programs" Dim ocn As New OleDbConnection(sconstr) Dim ocm As New OleDbCommand(txtsql, ocn) ocm.Connection.Open() Dim dta As OleDbDataAdapter = New OleDbDataAdapter(ocm) For Each Name As String In Lstexec.Items Dim trouvé as boolean = False Dim dreader As OleDbDataReader = ocm.ExecuteReader() While dreader.Read If dreader(0).ToString = Name Then trouvé = True End If Next End While if NOT Trouvé then lancerRequete("INSERT INTO Programs VALUES(...)") Next dreader.Close() ocm.connection.close()
Dim txtsql As String = "select * from Programs" Dim ocn As New OleDbConnection(sconstr) Dim ocm As New OleDbCommand(txtsql, ocn) ocm.Connection.Open() Dim dta As OleDbDataAdapter = New OleDbDataAdapter(ocm) For Each Name As String In Lstexec.Items Dim trouvé as boolean = False Dim dreader As OleDbDataReader = ocm.ExecuteReader() While dreader.Read If dreader(0).ToString = Name Then trouvé = True End If Next End While dreader.Close() if NOT Trouvé then lancerRequete("INSERT INTO Programs VALUES(...)") Next ocm.connection.close()
If Not trouvé Then lancerRequete("INSERT INTO Programs VALUES('" & Name.Replace("'", "''") & "')") End If