Export (0) Print
Expand All

SqlCeConnection Constructor

.NET Framework 1.1
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Initializes a new instance of the SqlCeConnection class.

Overload List

Initializes a new instance of the SqlCeConnection class.

Supported only by the .NET Compact Framework.

[Visual Basic] Public Sub New()
[C#] public SqlCeConnection();
[C++] public: SqlCeConnection();
[JScript] public function SqlCeConnection();

Initializes a new instance of the SqlCeConnection class with the specified connection string.

Supported only by the .NET Compact Framework.

[Visual Basic] Public Sub New(String)
[C#] public SqlCeConnection(string);
[C++] public: SqlCeConnection(String*);
[JScript] public function SqlCeConnection(String);

Example

[Visual Basic, C#] The following example creates and opens a SqlCeConnection.

[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of the SqlCeConnection constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Dim conn As New SqlCeConnection()
conn.ConnectionString = "Persist Security Info=False; Data Source = Northwind.sdf;" + _
  "Password = <password>; server=mySQLServer;Connect Timeout=30"

conn.Open()

[C#] 
SqlCeConnection conn = new SqlCeConnection();
conn.ConnectionString = "Persist Security Info=False; Data Source = Northwind.sdf;" + 
    "Password = <password>; server=mySQLServer;Connect Timeout=30";

conn.Open();

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

SqlCeConnection Class | SqlCeConnection Members | System.Data.SqlServerCe Namespace

Show:
© 2014 Microsoft