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

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

1114


Explain which name space is used to get assembly details?

1024


Difference between sqlcommand and sqlcommandbuilder?

1192


What is ado and rdo?

966


What is a string variable?

975


Define Execute Scalar?

1066


What are the pre-requisites for connection pooling?

1065


What are the ado.net objects?

981


Which ado.net object is very fast in getting data from the database?

1150


Why do we need ado.net?

1026


Explain what are acid properties?

1059


What are two types of transaction supported by ado.net?

1037


What is fill method in ado.net?

1038


What is microsoft ado?

1076


How to create data relations?

1054