The class OLEDBConnection represents the OLE DB connection.

  1. Oledb Excel Connection String
  2. Microsoft Oledb Provider For Excel
  3. Oledb Excel Blue Prism
Oledb Excel

In C# without using Excel Object we can insert, edit, delete, select etc. In cell content of an Excel file using OLEDB. You have to import System.Data in the project for doing these operations. For add new content in the cell or insert a new content, We can use the INSERT command like in SQL Operations.

Set

How to write into excel sheet using oledb connection or how to export dataset into excel sheet using oledb connection. Iam using console application in vb.net. If there are any alternate ways to write into the excel files from dataset. Msg 7403, Level 16, State 1, Line 2 The OLE DB provider 'Microsoft.ACE.OLEDB.12.0' has not been registered. This message will also pop up if you try to setup a linked server to the Excel file (when you 'browse the tables').

To use a OLEDBConnection class variable it first needs to be instantiated, for example

OLEDBConnection class variables can be set using the WorkbookConnection.OLEDBConnection procedure.

Excel

Methods

Oledb Excel Connection String

Other Methods

Excel

SaveAsODC - Saves the OLE DB connection as a Microsoft Office Data Connection file.

Properties

ADOConnection returns an ADO connection adoconnection if the PivotTable cache is connected to an OLE DB data source. Read-only.

AlwaysUseConnectionFile true if the connection file is always used to establish a connection to the data source.

BackgroundQuery true if queries for the OLE DB connection are performed asynchronously (in the background).

CalculatedMembers returns the CalculatedMembers collection for the specified connection.

CommandText returns or sets the command string for the specified data source. Read/write Variant.

CommandType returns or sets one of the XlCmdType constants.

Connection returns or sets a string that contains OLE DB settings that enable Microsoft Excel to connect to an OLE DB data source.

EnableRefresh true if the connection can be refreshed by the user. The default value is True.

IsConnected returns True if the MaintainConnection property is True. Returns False if it is not currently connected to its source.

LocalConnection returns or sets the connection string to an offline cube file. Read/write String.

LocaleID returns or sets the locale identifier for the specified connection.

MaintainConnection returns True if the connection to the specified data source is maintained after the refresh operation and until the workbook is closed.

Oledb Excel

MaxDrillthroughRecords returns or sets the maximum number of records to retrieve.

OLAP returns True if the OLE DB connection is connected to an Online Analytical Processing (OLAP) server.

Parent returns the parent object for the specified object. Read-only.

RefreshDate returns the date on which the OLE DB connection was last refreshed.

Refreshing true if a background OLE DB query is in progress for the specified OLE DB connection.

Microsoft Oledb Provider For Excel

RefreshOnFileOpen true if the connection is automatically updated each time the workbook is opened. The default value is False.

RefreshPeriod returns or sets the number of minutes between refreshes.

RetrieveInOfficeUILang true if the data and errors are to be retrieved in the Office user interface display language when available.

RobustConnect returns or sets how an OLE DB connection connects to its data source.

SavePassword true if password information in an OLE DB connection string is saved in the connection string. False if the password is removed.

ServerCredentialsMethod returns or sets the type of credentials that should be used for server authentication.

Oledb Excel

ServerFillColor true if the fill color format for the OLAP server is retrieved from the server when using the specified connection.

ServerFontStyle true if the font style format for the OLAP server is retrieved from the server when using the specified connection.

Oledb Excel Blue Prism

ServerNumberFormat true if the number format for the OLAP server is retrieved from the server when using the specified connection.

ServerSSOApplicationID returns or sets a single sign-on application (SSO) identifier that is used to perform a lookup in the SSO database for credentials.

ServerTextColor true if the text color format for the OLAP server is retrieved from the server when using the specified connection.

SourceConnectionFile returns or sets a String indicating the Microsoft Office Data Connection file or similar file that was used to create the connection.

SourceDataFile returns or sets a String indicating the source data file for an OLE DB connection.

UseLocalConnection true if the LocalConnection property is used to specify the string that enables Microsoft Excel to connect to a data source. False if the connection string specified by the Connection property is used.