What should you do to ensure that the application can connect to any type of database?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

You need to ensure that the application can connect to any type of database.

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

You need to ensure that the application can connect to any type of database.

What should you do?

A.
Set the database driver name in the connection string of the application, and then create the connection object in the following manner.
DbConnection connection = new OdbcConnection(connectionString);

B.
Set the database provider name in the connection string of the application, and then create the connection object in the following manner.
DbConnection connection = new OleDbConnection(connectionString);

C.
Create the connection object in the following manner.
DbProviderFactory factory = DbProviderFactories.GetFactory(“System.Data.Odbc”);
DbConnection connection = factory.CreateConnection();

D.
Create the connection object in the following manner.
DbProviderFactory factory = DbProviderFactories.GetFactory(databaseProviderName);
DbConnection connection = factory.CreateConnection();



Leave a Reply 0

Your email address will not be published. Required fields are marked *