macgiver159
Messages postés37Date d'inscriptionlundi 13 janvier 2003StatutMembreDernière intervention18 décembre 2007
-
28 janv. 2006 à 11:36
Julien237
Messages postés883Date d'inscriptionvendredi 3 novembre 2000StatutMembreDernière intervention 3 mars 2009
-
28 janv. 2006 à 13:11
Bonjours,
J'ai crer un programme qui utlise des base de donnée et quand je veut le tester j'ai ce message :
An unhandled exception of type 'System.InvalidCastException' occurred in system.data.dll
Additional information: The data value could not be converted for reasons other than sign mismatch or data overflow. For example, the data was corrupted in the data store but the row was still retrievable.
Merci de votre aide.
Voici mon programme :
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports Microsoft.VisualBasic
Public
Class Form1
Inherits System.Windows.Forms.Form
(Religion....)
Private
Sub Form1_Load(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles
MyBase.Load
Dim MyConnexion
As OleDb.OleDbConnection =
New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\Documents and Settings\Jérémy\Mes documents\Visual Studio Projects\base.mdb")
Dim Mycommand
As OleDb.OleDbCommand = MyConnexion.CreateCommand()
Mycommand.CommandText = "SELECT * FROM alliments"
MyConnexion.Open()
Dim myReader
As OleDb.OleDbDataReader = Mycommand.ExecuteReader()
Do
While myReader.Read()
ListBox1.Items.Add(myReader.GetString(0))
Loop
myReader.Close()
MyConnexion.Close()
End
Sub
Private
Sub Button1_Click(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles Button1.Click