.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

What is Web.config?

Posted By :Gowthammanju     Posted Date :June 28, 2011    Points :40   Category :.NET Framework 
Web.config file is a collection of settings.
like
database.
session state.
connection string relted info
if u want to do any change we can perform here so it reflect to entire project.

Example:
we develop a project for a company, that company shifted a new place where we have a different p.c.that time what we do simply change the connectin string reside in web,cofig file

You can also find related Interview Question to What is Web.config?  below: 

What is Machine.config?

  
Machine configuration file: The machine. config file contains settings that apply to the entire computer. This file is located in the %runtime install path%Config directory. There is only one
machine. config file on a computer. The Machine.Config file found in the "CONFIG" subfolder of your .NET Framework install directory (c:WINNTMicrosoft.NETFramework{Version Number}CONFIG on Windows 2000 installations). The machine.config, which can be found in the directory $WINDIR$Microsoft.NETFrameworkv1.0.3705CONFIG, is an XML-formatted configuration file that specifies configuration options for the machine. This file contains, among many other XML elements, a browserCaps element. Inside this element are a number of other elements that specify parse rules for the various User-Agents, and what properties each of these parsings supports. (More...)

what is the use of using web.config file

  
By using this web.config file we can store sqlconnection string.This SqlConnection String can be accessed any where in your application.for security purpose of connection string also we can use web.config. (More...)

How you will write a Connection String in web.Config fiel?

  
Ans) Then write below lines of code:

configuration>
connectionStrings>
add name="sqlconnectionstring" connectionString="Data Source=INTHIYAAZ;Initial Catalog=DB;User ID=sa;Password=sa" />
/connectionStrings>
/configuration>
(More...)

Can we have more than one web.config file in our application?

  
Yes,we can create or use more than one web.config file in our application. (More...)

if we remove a web.config file from the application , is this application will work?

  
It Depends on coding if we used something that is required to pioc values from configuration file then its required otherwise we can run our application without web.config. (More...)

Can i add more than 1 web.config file in a single application?

  
Yes, it is possible to add more than 1 web.config file in a single application. (More...)

Is it possible to add multiple Machine.config file?

  
No, it is not possible to add more than 1 machine.config file. if we want to overwrite any setting than that can be achieve with the help of web.config. (More...)

Is it possible to update a connection string stored in the Web.config file programatically? If Yes, then how?

  
Yes.

Create a Configuration object. Then, update the connection string using the ConnectionStrings collection. Finally, call Configuration.Save. (More...)

How do you retrieve the customized properties of a .NET application from XML .config file?

  
Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. (More...)

When is web.config called?

  
Web.config is an xml configuration file. It is never directly called unless we need to retrieve a configurations setting. (More...)

How many weg.config can an application have?

  
You can have one weg.config file in asp.net application in root level folder. But in an application you can have multiple in sub folder. (More...)

can asp.net website runs without web.config file?

  
Yes, and it will take the default setting from machine.config file from the machine. so web.config file is not necessary or must for running or publishing website or web application. (More...)

Any asp.net application can hold more then one web.config?

  
yes asp.net application can hold more then one web.config but not in the root folder (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend