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 DataReader class do in ADO.NET ?

1043


Why do we use sqldataadapter?

915


What are all the classes that are available in System.Data Namespace?

972


What is difference between dataset and datatable?

1101


What is the difference between Data adaptor and Data set?

982


What are typed and untyped dataset?

1060


What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?

955


Is ado.net an orm?

910


What two types of data providers does ADO.NET supply? What determines which one you should use?

953


describe the dataset object in ado.net.

917


What are the namespaces used in ADO.Net to connect to a database?

1127


What is the difference between Command and CommandBuilder object?

1133


What are different layers of ADO.Net?

1049


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

956


How do you update database through dataset?

946