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 typed and untyped dataset?
What are the connected and disconnected modes in ado.net?
What is DataReader Object?
What is the usage of the dataset object in ado.net?
What is the difference between SqlCommand and SqlCommandBuilder?
Explain the namespaces in which .net has the data functionality class.
What is a datagridview?
What is untyped dataset?
How can we check that some changes have been made to dataset since it was loaded?
What is the difference between DataReader and DataSet in ADO.NET?
What is serialization and de-serialization in .net?
What is difference between ado.net and asp net?
What is the use of SqlCommand object?
What are the objects of ado.net?
What is difference between datareader and dataadapter?