How do you retrieve information from web.config ?

Answers were Sorted based on User's Feedback



How do you retrieve information from web.config ?..

Answer / ansu_kumar

generaly we store our connection string in web.config file
under tag
<appsetting>
<add key=connection_string
value="data source=......"/>
</appsetting>
and
for accessing the value
in aspx page we writes
string const=
configurationsetting.appsetting.connection_string

Is This Answer Correct ?    3 Yes 0 No

How do you retrieve information from web.config ?..

Answer / sudhir kunnure

In web.congig you can add key and its value.And that key
value u can retrive like

string connectionString =
System.Configuration.ConfigurationSettings.AppSettings
["conStringWeb"].ToString()

Here conStringWeb is my key and i access its value.

Is This Answer Correct ?    3 Yes 0 No

How do you retrieve information from web.config ?..

Answer / anand

we use as
<appsetting>
<add name="connection" connectionString="Data
Source=...;Initial Catalog=database_name;User
ID=..;Password=.."/>
</appsetting>
and in page
string strConnString =
ConfigurationManager.ConnectionStrings["connection"].ConnectionString.ToString();

Is This Answer Correct ?    4 Yes 1 No

How do you retrieve information from web.config ?..

Answer / sam

using ConfigurationManager, Configuration classes
Example
ConfigurationManager.ConnectionStrings
["str"].ConnectionString;

Is This Answer Correct ?    0 Yes 0 No

How do you retrieve information from web.config ?..

Answer / vikram

By using Configuration Manager we can get information
<appsetting>
<add key=img
value="data source=......"/>
</appsetting>

we can use appsetting
configurationManager.appsetting["img"]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

What is the purpose of using MVC programming pattern in ASP.NET?

0 Answers   PUCIT,


Can we make a class with class with same;suppose public class abc { public class abc { } }

1 Answers  


How to prevent client side validation from the ASP.NET validation controls?

0 Answers   Viscus Infotech,


Which namespace do the classes, allowing you to support COM functionality, are located?

1 Answers  


what is loosely coupled solution? How it can be used?

0 Answers   Siebel,






What is difference between asp state management and asp.net state management?

0 Answers  


Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?

0 Answers  


Different type of validation controls in asp.net ?

1 Answers   CTS, Keane India Ltd,


hi i am varinder. i am very eager to learn ASP.net in C#. i am beginer to it. i have refer some books but i found it tuff to understand. their language is tuff. So please tell me the best site or best book to learn ASP.net in C#. i will be very thankful. Varinder

1 Answers  


How to authenticate users using Web.Config ?

1 Answers   Accenture,


what is DLL Hell and how it is solved in .NET? please explain clearly??

0 Answers   TCS,


What is the maximum number of classes that can be contained in one dll file?

0 Answers  


Categories