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 all the different authentication techniques used to connect to MS SQL Server?
Can we do database operations without using any of the ado.net objects?
What is dao and ado?
What is command class in ado.net?
What is adodb dll?
Explain what is datagrid with an example?
Explain the various objects in dataset.
What are the benefits of using of ADO.NET in .NET 4.0?
What is Data view?
Which ado.net object is very fast in getting data from the database?
What is an orm, and why would you use one instead of plain old ado.net?
What is DataRowCollection?
What is ado.net in mvc?
Define ado.net?
describe the dataset object in ado.net.