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
What are the advantages using ado.net?
What are the different methods by which we can populate a dataset?
What is data control techniques?
What is the default provider in ado.net?
Explain the difference between sqlcommand object and command behavior object?
What is the use of data grid?
Give an example of a .net application which connects to microsoft access database using ado.net classes.
What is the difference between connected and disconnected environment?
What is ado oledb and odbc?
How to identify the updated rows in a dataset?
What is meant by executenonquery?
What is ado.net and its architecture?
Define isolation?
What provider ado.net use by default? Explain the role of data provider in ado.net?
The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx