EntityConnection, constructeur (String)
[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]
Initialise une nouvelle instance de la classe EntityConnection, selon la chaîne de connexion.
Espace de noms : System.Data.Entity.Core.EntityClient
Assembly : EntityFramework (dans EntityFramework.dll)
Syntaxe
'Déclaration
<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification := "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")> _
Public Sub New ( _
connectionString As String _
)
'Utilisation
Dim connectionString As String
Dim instance As New EntityConnection(connectionString)
[SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
[SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public EntityConnection(
string connectionString
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA2214:DoNotCallOverridableMethodsInConstructors")]
[SuppressMessageAttribute(L"Microsoft.Reliability", L"CA2000:DisposeObjectsBeforeLosingScope", Justification = L"Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")]
public:
EntityConnection(
String^ connectionString
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")>]
[<SuppressMessageAttribute("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Object is in fact passed to property of the class and gets Disposed properly in the Dispose() method.")>]
new :
connectionString:string -> EntityConnection
public function EntityConnection(
connectionString : String
)
Paramètres
- connectionString
Type : System.String
Chaîne de connexion spécifique au fournisseur.
Exceptions
Exception | Condition |
---|---|
ArgumentException | Un mot clé de chaîne de connexion non valide a été fourni ou un mot clé de chaîne de connexion obligatoire n'a pas été fourni. |