connexion bdd sql serveur locale
	
	
		Bonsoir,
J'ai créé une BDD avec sql serveur 2005 express.
Maintenant je souhaite l'utiliser en local avec vb.net express.
J'ai ectis le code suivant mais cela ne fonctionne pas :
	Code:
	
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
   | Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Form1
    Inherits System.Windows.Forms.Form
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        
        TextBox1.Text = Today
        'connexion bdd
        Dim MyConnexion As SqlConnection = New SqlConnection("Database1.mdf")
        'MessageBox.Show("connect")
        Dim Mycommand As SqlCommand = MyConnexion.CreateCommand()
        Mycommand.CommandText = "SELECT numero FROM hlppairs WHERE utilise = 0"
        MyConnexion.Open()
        Dim myReader As SqlDataReader = Mycommand.ExecuteReader()
        Do While myReader.Read()
            MessageBox.Show("myReader.GetString(1)")
        Loop
        myReader.Close()
        MyConnexion.Close()
 
    End Sub | 
 merci de votre aide
eric
débutant qui débute