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

Explain the difference between an ado.net dataset and an ado recordset?

1061


How can we perform transactions in .net?

1060


What is difference between executenonquery and executequery?

975


What is ado in agriculture?

966


What is connection string?

1004


Explain the difference between sqlcommand object and command behavior object?

1085


What are the types of databinding?

993


how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

1015


List the 4 common ado.net namespaces?

1170


What does sqldatareader return?

965


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

1027


Which database is the ado.net?

976


Which method is used by command class to execute SQL statements that return single value?

1046


What are good ado.net object to replace to ado recordset object.

1123


What is the difference between data reader and data adapter?

1033