asp.net.ph

OleDbConnection Constructor ( )

System.Data.OleDb Namespace   OleDbConnection Class


Initializes a new instance of the OleDbConnection class.

[ VB ]
Overloads Public Sub New ( )

[ C# ]
public OleDbConnection ( );

[ C++ ]
public: OleDbConnection ( );

[ JScript ]
public function OleDbConnection ( )

Remarks

When an instance of OleDbConnection is created, the following read/write properties are set to initial values, unless they are specifically set using their associated keywords in the ConnectionString property.

Properties Initial Value
ConnectionString empty string ( "" )
ConnectionTimeout 15
Database empty string ( "" )
DataSource empty string ( "" )

You can change the value for these properties only by using the ConnectionString property.

Example

The following example initializes and opens an OleDbConnection using this constructor.

OleDbConnection myConn = new OleDbConnection ( );
myConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=myData.mdb";
myConn.Open ( );
  C# VB

See Also

OleDbConnection Members   ConnectionString   OleDbConnection Constructor Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph