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 are the major difference between classic ADO and ADO.NET?

1014


What is bubbled event?

981


What is ado circle?

1141


Explain the architecture of ado.net?

1070


What are advantages of microsoft-provided data provider classes in ado.net?

1008


What is sql connection in ado.net?

951


Explain executenonquery?

1143


What are the core objects of ADO.NET?

1048


What is acid in ado.net?

1040


Explain the advantage of ADO.Net?

991


What are the data providers used in ado.net

1025


What is ado.net code?

938


Which object of ado contains datarow datacolumn collection?

967


Which is better entity framework or ado.net?

1053


How to connect and retrieve data from database using dataset

1060