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 |
How can you register a custom server control to a web page?
What is the sequence of operation takes place when a page is loaded ?
How can we update records in gridview?Is there any appropriate code for it?
What is mta?
what is an Eventbubbling?
repeater and gridview diff? Why is repeater fast than gridview?
What is the main function of url routing system in asp.net mvc? : asp.net mvc
How tooltip is set through code-behind in ASP.NET?
Is asp net front end or backend?
I have one application, one user purchase some products in my application? and another person came he is also purchase some products?how can we identify which user purchase which items? my answer is by using session id? but i dont know how? can u give me programming for that?
When we use cookie less session? Explain its working?
0 Answers Sans Pareil IT Services,
What is the sequence in which ASP.NET events are processed?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)