Explain how to retrieve information from the configuration file at run time. How would you store information in the configuration file at design time?

1 Answer

Answer :

You must first create an instance of AppSettingsReader to read the configuration file. You can then call the GetValue method to read values represented in the configuration file. To add configuration file entries, you should create elements in the node of the configuration file. In the element, you should specify a value for the entry and a key that can be used to retrieve the entry. The value can be changed between executions of the application.

Related questions

Description : Describe how to use code to retrieve resources at run time.

Last Answer : You must first create an instance of the ResourceManager class that is associated with the assembly that contains the desired resource. You can then use the GetString method to retrieve string resources or the GetObject method to retrieve object resources.

Description : Describe how to retrieve the ASCII key code from a keystroke. How would you retrieve key combinations for non-ASCII keys?

Last Answer : Keystrokes can be intercepted by handling the KeyPress and KeyDown events. Both of these events relay information to their handling methods in the form of their EventArgs. The KeyPressEventArgs, ... you would handle the KeyDown event and use the properties exposed by the KeyEventArgs instance.

Description : What is the lifespan for items stored in ViewState? Select Answer:  1. Item stored in ViewState exist for the life of the current page  2. Item stored in ViewState exist for the life ... of the current Applicaiton  4. Item stored in ViewState exist for the life of the current configuration

Last Answer : 1. Item stored in ViewState exist for the life of the current page AS any web application works on request and response basis ,so on every post backs, The data in control gets lost. To retain page ... control with data. The life cycle of the view state exist for life of current running page only. 

Description : Describe a general strategy for creating a setup project that terminates installation if a specific file is not already installed on the target machine.

Last Answer : First, create a file search to search the file system for the specific file. Then create a launch condition to evaluate the results of the search. You can connect the launch condition to ... in the search's Property property in the expression specified by the launch condition's Condition property. 

Description : How do you generate documentation from the C# file commented properly with a command-line compiler? 

Last Answer : Compile it with the /doc switch. 

Description : How do you generate documentation from the C# file commented properly with a command-line compiler?

Last Answer : Compile it with the /doc switch.

Description : Describe in general terms how to add a control to a form at run time.

Last Answer : You must first declare and instantiate a new instance of the control. Then, you must add the control to the form�s Controls collection. Once the control has been added to the Controls collection, you must manually set properties that govern the control�s position and appearance.

Description : Define what is the difference between compile-time polymorphism and run-time polymorphism?

Last Answer : Compile time Polymorphism Compile time Polymorphism also known as method overloading. Method overloading means having two or more methods with the same name but with different signatures. Run time ... or more methods with the same name, same signature but with a different implementation.

Description : What are design patterns?

Last Answer : “Design patterns are recurring solutions to software design problems you find again and again in real-world application development.” 

Description : Does an object need to be made to run main?

Last Answer : No

Description : Can you store multiple data types in System.Array?

Last Answer : No. 

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : Can you store multiple data types in System.Array?

Last Answer : No.

Description : Selective retention occurs when? a) we process, store, and retrieve information that we have already selected, organized, and interpreted b) we make choices to experience particular stimuli c ... choices to avoid particular stimuli d) we focus on specific stimuli while ignoring other stimuli

Last Answer : a) we process, store, and retrieve information that we have already selected, organized, and interpreted

Description : Report generatorsare usedto A. store data input bya user B. retrieve information from files C. answer queries D. both (b)and (c) E. None of the above

Last Answer : both (b)and (c)

Description : Which of the following areadvantagesof CD-ROM as a storage media? (A) CD-ROM is aninexpensive way to store large, amount of data and information (B) CD-ROM disks retrieve data and information more quickly than ... (C) CD-ROMs make lesserrors than magnetic media (D) An of the above (E) None of these

Last Answer : An of the above

Description : This operates algorithmically or using a mixture of algorithmic and human input to collect, index, store and retrieve information on the web (e.g. web pages, images, information and other types of files). It makes the ... is referred to as: 1. Banner ads 2. Pop-up ads 3. A search engine 4. Apps

Last Answer : A search engine

Description : Which of the following is the appropriate definition of a computer ? (A) Computer is a machine that can process information. (B) Computer is an electronic device that can store, ... ) Computer is a machine that can store, retrieve and process quickly and accurately only qualitative information

Last Answer : (B) Computer is an electronic device that can store, retrieve and process both qualitative and quantitative data quickly and accurately.

Description : Which one of the following tools is used to view the metadata information contained in a .NET assembly? Select Answer:  1. al.exe  2. ilasm.exe  3. vbx.exe  4. csc.exe  5. ildasm.exe

Last Answer :  5. ildasm.exe

Description : Can you tell me how to retrieve items that I've deleted from my 'deleted items' file?

Last Answer : answer:I have had good luck with the free Windows program Recuva http://www.piriform.com/recuva

Description : How do i retrieve the firefox password file?

Last Answer : answer:Go to Tools—>Options—>Security—>On Options screen,Click “Saved Password” button On the same screen click “Show passwords” button & then” Are you sure you wish to show your passwords?” pop up click “Yes button.

Description : How do I retrieve a game that I purchased from the iTunes Store?

Last Answer : answer:As far as I know, there's no way to retrieve the game yourself, but you can contact iTunes (use the email form) and ask for help. My understanding is that Apple has an informal policy to let ... 's worth a try. It wouldn't hurt if you were a former child-actor with a widely-read blog.

Description : Circular division of disks to store and retrieve data are known as A) tracks B) sectors C) cycles D) rings

Last Answer : Answer : A

Description : Regarding data, computers are very good at A) store B) Processing C) retrieve D) All of above

Last Answer : Answer : D

Description : The term ________ refers to data storage systems that make it possible for a computer or electronic device to store and retrieve data. A. input technology B. output technology C. storage technology D. None of the Above

Last Answer : C. storage technology

Description : Simple Storage Service use for? A. It allows the users to store and retrieve various types of data using API calls. B. It does contain computing element. C. Both A and B D. None of the above

Last Answer : It allows the users to store and retrieve various types of data using API calls.

Description : Digital magnetic tape recorders used to store and retrieve digital data fall into what three categories?

Last Answer : a. Computer-compatible digital tape recorders. b. Telemetry digital tape recorders. c. Instrumentation digital tape recorders

Description : Explain how to use the PrintPreviewDialog control to display a preview of a printed document before it is printed.

Last Answer : You display a preview of a printed document with the PrintPreviewDialog control by first setting the PrintDocument property of the PrintPreviewDialog instance to the PrintDocument you want to preview, then by calling the PrintPreviewDialog.Show command to display the dialog box. 

Description : Explain the difference between Globalization and Localization.

Last Answer : Globalization refers to the application of culture-specific format to existing data. Localization refers to providing new culture-specific resources and retrieving the appropriate resources based on the culture setting. 

Description : Explain how to convert data in legacy code page formats to the Unicode format.

Last Answer : You can use the Encoding.Convert method to convert data between encoding types. This method requires instances of both encoding types and an array of bytes that represents the data to be converted. ... GetBytes method and can convert an array of bytes back to chars with the Encoding.GetChars method.

Description : Explain how to use the HelpProvider component to provide help for UI elements.

Last Answer : You can provide either a HelpString or a help topic for UI elements with the HelpProvider. The HelpProvider provides HelpString, HelpKeyWord, and HelpNavigator properties for each control on the form. If ... particular element is displayed when the element has the focus and the F1 key is pressed.

Description : Explain how to use the Begin and End methods on a Web Service to make an asynchronous method call.

Last Answer : Every public Web method on a Web Service can be called either synchronously or asynchronously. To make an asynchronous call to a Web method, you call the method named Begin, where is the name of ... returned by Begin. This will allow you to retrieve the actual data returned by the Web method.

Description : Describe an abstract class and explain when one might be useful.

Last Answer : An abstract class is a class that cannot be instantiated but must be inherited. It can contain both implemented methods and abstract methods, which must be implemented in an inheriting class. ... common interface for other methods, and leave more detailed implementation up to the inheriting class.

Description : Briefly explain encapsulation and why it is important in object-oriented - programming.

Last Answer : Encapsulation is the principle that all of the data and functionality required by an object be contained by that object. This allows objects to exist as independent, interchangeable units of functionality without maintaining dependencies on other units of code.

Description : Briefly explain how to convert a string representation of a number to a numeric type, such as an Integer or a Double.

Last Answer : All numeric data types have a Parse method that accepts a string parameter and returns the value represented by that string cast to the appropriate data type. You can use the Parse method of each data type to convert strings to that type.

Description : Explain what a delegate is and how one works. 

Last Answer : A delegate acts like a strongly typed function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods.

Description : Explain how properties differ from fields. Why would you expose public data through properties instead of fields?

Last Answer : Properties allow validation code to execute when values are accessed or changed. This allows you to impose some measure of control over when and how values are read or changed. Fields cannot perform validation when being read or set.

Description : Explain why you might use enums and constants instead of their associated literal values.

Last Answer : Enums and constants make code easier to read and maintain by substituting human-legible tokens for frequently used constant values.

Description : Explain when a type conversion will undergo an implicit cast and when you must perform an explicit cast. What are the dangers associated with explicit casts?

Last Answer : Types can be implicitly converted when the conversion can always take place without any potential loss of data. When a potential loss of data is possible, an explicit cast is required. If an explicit cast is improperly performed, a loss of data precision can result, or an exception can be thrown.

Description : Explain when you might implement a shortcut menu instead of a main menu.

Last Answer : If every possible option is exposed on a main menu, the menu can become busy and hard to use. Shortcut menus allow less frequently used options to be exposed only in situations where they are likely to be used.

Description : Briefly explain the difference between Public (public), Friend (internal), and Private (private) access levels as they apply to user-defined types and members.

Last Answer : In user-defined types, Public (public) classes can be instantiated by any element of the application. Friend (internal) classes can be instantiated only by members of the same assembly, and Private ( ... the same assembly, and Private (private) members can be accessed only from within the type. 

Description : Explain what constructors and destructors are and describe what they are used for.

Last Answer : The constructor is the method that initializes a class or structure and is run when a type is first instantiated. It is used to set default values and perform other tasks required by the class. ... reclaimed by garbage collection. It contains any code that is required for cleanup of the object. 

Description : Briefly explain what is meant by a reference type and a value type.

Last Answer : A value type holds all of the data represented by the variable within the variable itself. A reference type contains a reference to a memory address that holds the data instead of the actual data itself. 

Description : Explain ACID rule of thumb for transactions.

Last Answer : A transaction must be: 1. Atomic - it is one unit of work and does not dependent on previous and following transactions. 2. Consistent - data is either committed or roll back, no in-between ... . Durable - the values persist if the data had been committed even if the system crashes right after. 

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

Description : Explain sizeof and typeof.

Last Answer : typeof obtains the System.Type object for a type and sizeof obtains the size of a type.

Description : Explain ACID rule of thumb for transactions.

Last Answer : A transaction must be: 1. Atomic - it is one unit of work and does not dependent on previous and following transactions. 2. Consistent - data is either committed or roll back, no in-between ... 4. Durable - the values persist if the data had been committed even if the system crashes right after.

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources). 

Description : Explain the “static” keyword in C#?

Last Answer : “Static” keyword can be used for declaring a static member. If the class is made static then all the members of the class are also made static. If the variable is made static then it will have a single instance and the value change is updated in this instance.

Description : Explain namespaces in C#?

Last Answer : Namespaces are containers for the classes. We will use namespaces for grouping the related classes in C#. “Using” keyword can be used for using the namespace in other namespaces.