Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / koteswara rao.chava

SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
Get_Conn("TSQL");
//Get_Conn("ACCESS");
//Get_Conn("ORACLE");


}
protected void Get_Conn(string con_condition_Str)
{
switch (con_condition_Str)
{
case ("ACCESS"):
//SET CON = access constring
break;
case ("TSQL"):
// SET CON = SQL SERVER constring
break;
case ("ORACLE"):
// SET CON = ORACLE constring
break;
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 3 major types of connection objects in ado.net?

994


Explain why canot we use multiple inheritance and garbage collector paralelly in .net?

1019


What are the data providers used in ado.net

1017


What is the difference between executequery and executenonquery?

904


Explain the namespaces in which .net has the data functionality class.

1073


What is a dataview?

968


Explain how do you connect to sql server database without using sqlclient?

1001


Data reader read and forward only, how is it possible to get 2 tables of data at a time?

910


What is difference between datareader and dataadapter?

1044


Define table relations?

970


Define partial class?

950


Which is faster sqldataadapter and sqldatareader?

909


How do you update a dataset in ado.net and how do you update database through dataset?

922


Which architecture does Datasets follow?

1035


What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?

1333