Se connecter avec
S'enregistrer | Connectez-vous

[vb.net]Crystal report + requête SQL

Dernière réponse : dans Programmation
Lassé par la pub ? Créez un compte

J'utilise Microsoft SQL Server 2005 pour ma base de donnée

Voici commente je fait le connexion a ma base de donnée


Dim MyConnexion As SqlConnection = New SqlConnection("Data Source=GUIDARA-PC\SQLEXPRESS;" & _
"Integrated Security=SSPI;Initial Catalog=test")
Dim Mycommand As SqlCommand = MyConnexion.CreateCommand()

Mycommand.CommandText = "SELECT nom_test FROM test_1"
MyConnexion.Open()
Dim myReader As SqlDataReader = Mycommand.ExecuteReader()

myReader.Read()
myReader.GetValue(0)
...
...

myReader.Close()
MyConnexion.Close()
Lassé par la pub ? Créez un compte
Tom's guide dans le monde