How do you retrieve information from web.config ?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / sam
using ConfigurationManager, Configuration classes
Example
ConfigurationManager.ConnectionStrings
["str"].ConnectionString;
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Difference between asp and asp.net?
How do you secure your configuration files to be accessed remotely by unauthorized users?
Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
what is dumpbin.exe?
Clearly Explain the ispostback
witch is the best insistute in sharpoint course.what abt future of share point course.
How do you enable tracing? a) Set the Trace property of the Web Form to True b) Set the Trace property of the server object to True c) Set the Session variables Trace to True d) Set the Applications Variable Trace to True.
How to manage different kinds of sessions in ASP.NET?
What is the latest version of asp.net?
How can u handle Un Managed Code Exceptions in ASP.Net?
what is the difference b/w .net 1.1 and 2.0 ?
What are different transaction options?