试题详情
- 单项选择题 You work as an application developer at Contoso.com. You use Microsoft .NET Framework 3.5 and Microsoft ADO.NET to develop an application. You want to make sure that the application is operative to any type of database. What should you do?()
A、 Set the database driver name in the connection string of the application, and then the connection object as follows: DbConnection connection = new OdbcConnection(connectionString);
B、 Create the connection object as follows: DbProviderFactory factoryDbProviderFactories.GetFactory(databaseProviderName); DbConnection connection =factory.CreateConnection();
C、 Create the connection object as follows: DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.Odbc"); DbConnection connection = factory.CreateConnection();
D、 Set the database driver name in the connection string of the application, and then the connection object as follows:DbConnection connection = new OleDbConnection(connectionString);
- B
关注下方微信公众号,在线模考后查看
热门试题