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 typed and untyped dataset?

1101


What are the connected and disconnected modes in ado.net?

909


What is DataReader Object?

1038


What is the usage of the dataset object in ado.net?

958


What is the difference between SqlCommand and SqlCommandBuilder?

1071


Explain the namespaces in which .net has the data functionality class.

1076


What is a datagridview?

1040


What is untyped dataset?

1092


How can we check that some changes have been made to dataset since it was loaded?

966


What is the difference between DataReader and DataSet in ADO.NET?

1157


What is serialization and de-serialization in .net?

923


What is difference between ado.net and asp net?

1035


What is the use of SqlCommand object?

1223


What are the objects of ado.net?

1063


What is difference between datareader and dataadapter?

1045