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...

How to you declare connection strings and how to you make
use of web.config ?

Answer Posted / prasad

In web.config file just plase

<appSettings>
<add key="ConStr" value="Provider=SQLOLEDB.1;User
ID=sa;Initial Catalog=Sample;Data Source=ABC"></add>
</appsettings>

and in CS file

sqlconnection con = new sqlconnection
(ConfigurationSettings.AppSettings["ConStr"]);

and u can u this connection any where in ur App.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between executenonquery and executequery?

904


Describe the disconnected architecture of ADO.NET’s data access model.

992


how we can fire event in databound coulm in datagfrid withot using button?

915


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

1272


Describe datareader object of ado.net with example.

869


How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

966


Is ado.net dead?

951


How we can provide data to ado.net?

977


Compare Data Reader & Dataset in ado.net?

941


Can datareader hold data from multiple tables?

1114


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

960


Explain ado.net features?

987


What is dataadapter in ado.net?

873


Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?

1088


What are all features of ADO.Net?

928