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 is the difference between statement and preparedstatement interface?

1045


What are the features of ado.net?

1112


What is row state?

1032


Is it possible to load multiple tables in a Dataset?

1141


What are the different methods available under the sqlcommand class to access the data?

1094


What is method to get XML and schema from Dataset? getXML() and get Schema ()

1013


Define Execute Scalar?

1060


What is ado.net components?

1001


What does executenonquery () method return?

979


What is the difference between data reader and data adapter?

1070


Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

1076


What is ado full form?

1071


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

1106


What are the data access namespaces in .NET?

1257


What is the current version of entity framework?

1017