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

Answer Posted / ansu kumar

in
web.config file
<appsetting>
<add key="constr" value="data source=database name;
database=database name"/>
</appsetting>

and
in .aspx file
string str=configurationsetting.appsetting.constr;

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the executescalar method?

789


Is it possible to load multiple tables in a Dataset?

754


What is ado connection?

702


What is the default timeout specified for "sqlcommand.commandtimeout" property?

756


Explian About DataAdapters

792


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

888


What are the namespaces used in ado.net for data access?

692


What is difference between Dataview and Datatable?

740


What are the various methods provided by the DataSet object to generate XML?

811


How to load multiple tables into a dataset?

734


What is the default Timeout for SqlCommand.CommandTimeout property?

738


What is oledb driver?

706


What is the significance of CommandBehavior.CloseConnection ?

841


What is bubbled event?

730


How can we perform transactions in .net?

790