Home > Net >  How to use IDataInitialize: OleDbConnection: GetDataSource method to initialize the connection attri
How to use IDataInitialize: OleDbConnection: GetDataSource method to initialize the connection attri

Time:05-17

I use VB.NET, we use the following three ways to connect to the database,

OdbcConnection SqlConnection as long as the attribute and the ConnectionString key words one by one in the processing, the OleDbConnection besides, also mentioned that OLE DB applications use IDataInitialize: : GetDataSource initialization data source object, this sentence from the official web site:

https://docs.microsoft.com/zh-cn/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client? Redirectedfrom=MSDN& View=SQL server - ver15


Among them, using IDataInitialize: : GetDataSource OLE DB applications use the connection string has the following syntax:

Connection - the string: :=empty - string [;] | attribute [;] | attribute; Connection - the string

Empty - string: :=

Attribute: :=attribute - keyword=
Quote:
attribute - value
Quote:


Attribute - value: :=character - string

The attribute - keyword: :=identifier

Quote: "=" | '


The main reason is that I don't know IDataInitialize: : what role does the GetDataSource, because set up after the ConnectionString, already can connect to the database, explain also look not to understand the club's official website,

Now, I want to know to use this IDataInitialize: : GetDataSource specific code examples, how to write the code inside?
  • Related