If we want to connect to many databases in dataaccess layer
such as MSAccess,Sql server,oracle means not to a particular
database depends on condition we have to connect to
appropriate database in this scenario if we without changing
code Ho wdo you handle this situation?

Answer Posted / ganesh

Create appropriate provider at run time(use factory
patterns) based on some configurations setting (probably a
XML file).This will allow user to decide providers
dynamicallly and enable connecting to whatever database he
wants

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is serialization and de-serialization in .net? How can we serialize the dataset object?

510


What is ole db query?

515


What is a dataview?

530


Which control of the BindingNavigator returns the current position within the data source?

729


Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.

551






What is ado.net code?

517


What is an ado?

514


What is ado.net objects?

516


What is an ado connection?

525


What is the default timeout specified for "sqlcommand.commandtimeout" property?

535


What is a non query?

512


Which object of ado contains datarow datacolumn collection?

510


Can we load multiple tables in a dataset?

538


What is an example of ordinal data?

483


What are the benefits of using ado.net?

511