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 difference between executenonquery and executequery?
Describe the disconnected architecture of ADO.NET’s data access model.
how we can fire event in databound coulm in datagfrid withot using button?
What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?
Describe datareader object of ado.net with example.
How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
Is ado.net dead?
How we can provide data to ado.net?
Compare Data Reader & Dataset in ado.net?
Can datareader hold data from multiple tables?
Explain why canot we use multiple inheritance and garbage collector paralelly in .net?
Explain ado.net features?
What is dataadapter in ado.net?
Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?
What are all features of ADO.Net?