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
How to bind the controls(best practice) comboboxes to the data in the dataset?
Define Execute Scalar?
What is a data control clerk?
What does datareader object do?
Does executenonquery return a value?
Explain how to call the sql commands asynchronously in ado.net version 2.0?
Which method is used to sort the data in ADO.Net?
What is connected architecture in ado.net?
What is difference between datagridview and datagrid control in winforms?
What is an example of ordinal data?
What is bubbled event can you please explain?
How we can provide data to ado.net?
What is the difference between the clone() and copy() methods of the dataset class?
What is executequery?
What is microsoft ado.net?