cs_bonagad
Messages postés87Date d'inscriptionvendredi 22 décembre 2006StatutMembreDernière intervention19 mai 2012
-
22 mai 2009 à 19:17
cs_casy
Messages postés7741Date d'inscriptionmercredi 1 septembre 2004StatutMembreDernière intervention24 septembre 2014
-
22 mai 2009 à 19:35
Bonjour à tous,
je suis un débutant en Vb.net.je fais actuellement le cours officiel de microsoft 2541B.j'ai démarré l'atelier où je dois pouvoir me connecter depuis mon site aspx à une base de données:Voici un code qui m'affiche les erreurs:
'''<summary>
''' Helper class for managing database connections.
'''</summary>
Friend NotInheritable Class ConnectionManager
'''<summary>
''' Creates a SqlConnection to the Adventureworks database on the local SQL Server 2005 instance.
''' Opens the connection, and returns the connection.
'''</summary>
'''<returns>An open connection to the Adventureworks database</returns>
Public Shared Function GetConnection()
As
SqlConnection
Dim Connection As SqlConnection = Nothing
Dim ChaineConnect As String
' Write code here, to create a SqlConnection object, open the connection, and return it.
ChaineConnect = "Data Source=(local); Initial Catalog=Adventureworks; " & _
"Integrated Security Info=true; Persist Security Info=false"
connection = New sqlconnection(ChaineConnect)
Connection.open()
Return Connection
End Function
End Class
End Namespace
Dans mon environnement de développement, Visual Sotudio 2005 souligne en vert les espaces de nom :
Imports System.Data
Imports System.Data.SqlClient
et lorsque j'approche la souris vers l'un de ces espaces, j'ai un info bulbe qui stipule :
Namespace or type specified in the 'System.Data' does'nt contain any public or cannot be found.Make sure that the namespace or type is defined and contains at least one public member.Make the imported element name doen't use any aliases.
ou
Namespace or type specified in the 'System.Data.SqlClient' does'nt contain any public or cannot be found.Make sure that the namespace or type is defined and contains at least one public member.Make the imported element name doen't use any aliases.
les erreurs des espaces de nom font que l'objet Connection de la classe SqlConnection n'a pas été reconnu.
voilà les erreurs que j'ai mentionné. j'espère que j'ai été suffisament claire.je vous souhaite tous bonne journée dans l'espoir d'une réponse favorable.
Cordialement,
cs_casy
Messages postés7741Date d'inscriptionmercredi 1 septembre 2004StatutMembreDernière intervention24 septembre 201440 22 mai 2009 à 19:35
Vérifie que l'assembly System.Data fait partie des références de ton projet (Menu Projet/Propriété, onglet référence, partie du bas, System.Data doit être présent et coché)