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 is the use of sqldatareader class?
What are the different row versions available in table?
What is the difference between dataset and datatable?
Describe connection object in ado.net
What is ado.net connection?
Explain how to pass multiple tables in datasets simultaneously?
Why is it important to close an ado.net application?
What are the differences between OLEDB and SQLClient Providers?
Which is faster dataset or datareader?
How will you fill the gridview by using datatable object at runtime?
Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?
What is difference between entity framework and ado.net?
How do you connect to sql server database without using sqlclient?
How to identify the updated rows in a dataset?
How does entity framework work?