inessss
sil vous plais j'ai un probleme dans mon programme vb toujours affiche un message d'exeption au line 12 je sais pas prk
sil vous plais me donner une solution c urgent
j'utilise vb studio 2008
MERCI D'AVANCE.....CORDIALEMENT
Private Sub cm2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cm2.SelectedIndexChanged
MyConnexion.Open()
Dim MyConnexion As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= e:\basedonnée.pfe.mdb;")
t3.Items.Clear()
Dim Mycommand2 As OleDbCommand = MyConnexion.CreateCommand()
Mycommand2.CommandText "SELECT contact.num_sec FROM section INNER JOIN contact ON section.num_sec contact.num_sec WHERE contact.ref_leonic='" & cm2.Text & "'"
Dim myReader2 As OleDbDataReader = Mycommand2.ExecuteReader()
Do While myReader2.Read()
t3.Items.Add(myReader2.GetString(0))
Utilisers les requetes paramètrées et pas de la concaténation de chaine
au passage.
Public Sub ReadOrderData(ByVal connectionString As String)
Dim queryString As String = _
"SELECT OrderID, CustomerID FROM dbo.Orders where name = @Name;"
Using connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(queryString, connection)
command.Parameters.Add(new SqlParameter("Name", "toto"))
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
Try
While reader.Read()
Console.WriteLine(String.Format("{0}, {1}", _
reader(0), reader(1)))
End While
Finally
' Always call Close when done reading.
reader.Close()
End Try
End Using
End Sub
inessss
l'exception oldbexception n'a pas été geré
Échec de IErrorInfo.GetDescription avec E_FAIL(0x80004005).
> ce sa le message qui l'affiche en cette phrase
// Dim myReader2 As OleDbDataReader = Mycommand2.ExecuteReader() //