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
Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?
Explain which name space is used to get assembly details?
Difference between sqlcommand and sqlcommandbuilder?
What is ado and rdo?
What is a string variable?
Define Execute Scalar?
What are the pre-requisites for connection pooling?
What are the ado.net objects?
Which ado.net object is very fast in getting data from the database?
Why do we need ado.net?
Explain what are acid properties?
What are two types of transaction supported by ado.net?
What is fill method in ado.net?
What is microsoft ado?
How to create data relations?