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 major difference between classic ADO and ADO.NET?
What is bubbled event?
What is ado circle?
Explain the architecture of ado.net?
What are advantages of microsoft-provided data provider classes in ado.net?
What is sql connection in ado.net?
Explain executenonquery?
What are the core objects of ADO.NET?
What is acid in ado.net?
Explain the advantage of ADO.Net?
What are the data providers used in ado.net
What is ado.net code?
Which object of ado contains datarow datacolumn collection?
Which is better entity framework or ado.net?
How to connect and retrieve data from database using dataset