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 |
What is the purpose of using MVC programming pattern in ASP.NET?
Can we make a class with class with same;suppose public class abc { public class abc { } }
How to prevent client side validation from the ASP.NET validation controls?
Which namespace do the classes, allowing you to support COM functionality, are located?
what is loosely coupled solution? How it can be used?
What is difference between asp state management and asp.net state management?
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?
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
How to authenticate users using Web.Config ?
what is DLL Hell and how it is solved in .NET? please explain clearly??
What is the maximum number of classes that can be contained in one dll file?