This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How To Generate Proxy Class Other Than .net App And Wsdl Tool? |
|
Answer» To access an XML Web service from a client APPLICATION, you first add a Web reference, which is a reference to an XML Web service. When you create a Web reference, Visual Studio creates an XML Web service proxy class automatically and adds it to your project. This proxy class exposes the methods of the XML Web service and handles the marshalling of appropriate arguments back and forth between the XML Web service and your application. Visual Studio uses the Web Services Description Language (WSDL) to create the proxy. To generate an XML Web service proxy class: From a command PROMPT, use Wsdl.exe to create a proxy class, specifying (at a MINIMUM) the URL to an XML Web service or a service description, or the path to a saved service description. To access an XML Web service from a client application, you first add a Web reference, which is a reference to an XML Web service. When you create a Web reference, Visual Studio creates an XML Web service proxy class automatically and adds it to your project. This proxy class exposes the methods of the XML Web service and handles the marshalling of appropriate arguments back and forth between the XML Web service and your application. Visual Studio uses the Web Services Description Language (WSDL) to create the proxy. To generate an XML Web service proxy class: From a command prompt, use Wsdl.exe to create a proxy class, specifying (at a minimum) the URL to an XML Web service or a service description, or the path to a saved service description. |
|
| 2. |
Are Web Services A Replacement For Other Distributed Computing Platforms? |
|
Answer» No. Web SERVICES is just a new way of LOOKING at EXISTING IMPLEMENTATION platforms. No. Web Services is just a new way of looking at existing implementation platforms. |
|
| 3. |
In A Webservice, Need To Display 10 Rows From A Table. Which Is The Best Choice Among Datareader Or Dataset? |
|
Answer» WEBSERVICE will SUPPORT only DATASET. WebService will support only DataSet. |
|
| 4. |
What Is A Webservice And What Is The Underlying Protocol Used In It? |
|
Answer» Web Services are applications delivered as a SERVICE on the Web. Web services allow for programmatic access of business logic over the Web. Web services TYPICALLY rely on XML- based protocols, messages, and interface descriptions for communication and access. Web services are DESIGNED to be used by other programs or applications rather than directly by end user. Programs INVOKING a Web service are called clients. SOAP over HTTP is the most commonly used protocol for invoking Web services. Web Services are applications delivered as a service on the Web. Web services allow for programmatic access of business logic over the Web. Web services typically rely on XML- based protocols, messages, and interface descriptions for communication and access. Web services are designed to be used by other programs or applications rather than directly by end user. Programs invoking a Web service are called clients. SOAP over HTTP is the most commonly used protocol for invoking Web services. |
|
| 5. |
Is It Possible For Me To Change My .aspx File Extension To Some Other Name? |
|
Answer» Yes.
Open Yes. Open |
|
| 6. |
What Are The Different Modes For The Sessionstates In The Web.config File? |
|
Answer» Off INDICATES that session state is not ENABLED. Off Indicates that session state is not enabled. |
|
| 7. |
What Is The Use Of sessionstate Tag In The Web.config File? |
|
Answer» Configuring session state: Session state features can be configured via the <sessionstate> SECTION in a web.config file. To double the DEFAULT TIMEOUT of 20 minutes, you can add the FOLLOWING to the web.config file of an application: <sessionState timeout="40"/>Configuring session state: Session state features can be configured via the <sessionstate> section in a web.config file. To double the default timeout of 20 minutes, you can add the following to the web.config file of an application: |
|
| 8. |
Asp.net - How To Find Last Error Which Occurred? |
|
Answer» ANSWER :
Server.GetLastError();
|
|
| 9. |
What Is Sql Injection? |
|
Answer» An SQL injection attack "injects" or manipulates SQL code by adding unexpected SQL to a query. Many web pages TAKE PARAMETERS from web USER, and make SQL query to the database. Take for instance when a user login, web page that user NAME and password and make SQL query to the database to check if a user has valid name and password. Username: ' or 1=1 ---Password: [Empty] This would EXECUTE the following query against the users table: select count(*) from users where userName='' or 1=1 --' and userPass=''An SQL injection attack "injects" or manipulates SQL code by adding unexpected SQL to a query. Many web pages take parameters from web user, and make SQL query to the database. Take for instance when a user login, web page that user name and password and make SQL query to the database to check if a user has valid name and password. This would execute the following query against the users table: |
|
| 10. |
How Do You Implement Postback With A Text Box? |
|
Answer» MAKE AUTOPOSTBACK PROPERTY to TRUE Make AutoPostBack property to true |
|
| 11. |
How Do You Use Css In Asp.net? |
|
Answer» Within the SECTION of an HTML document that will USE these styles, add a link to this external CSS style sheet that follows this FORM: <link REL="STYLESHEET" type="text/css" HREF="MyStyles.css" />MyStyles.css is the name of your external CSS style sheet.
Within the section of an HTML document that will use these styles, add a link to this external CSS style sheet that follows this form: MyStyles.css is the name of your external CSS style sheet.
|
|
| 12. |
Which Two Properties Are There On Every Validation Control? |
|
Answer» ControlToValidate, ERRORMESSAGE ControlToValidate, ErrorMessage |
|
| 13. |
How Do You Specify Whether Your Data Should Be Passed As Query String And Forms (mainly About Post And Get) |
|
Answer» Through ATTRIBUTE TAG of FORM tag. Through Attribute tag of Form tag. |
|
| 14. |
What Is Role-based Security? |
|
Answer» A role is a NAMED set of principals that have the same PRIVILEGES with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can USE role membership to determine whether a principal is authorized to PERFORM a requested action. A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can use role membership to determine whether a principal is authorized to perform a requested action. |
|
| 15. |
Which Asp.net Configuration Options Are Supported In The Asp.net Implementation On The Shared Web Hosting Platform? |
|
Answer» Many of the ASP.NET configuration options are not configurable at the site, application or subdirectory level on the SHARED hosting platform. Certain options can affect the SECURITY, PERFORMANCE and stability of the server and, therefore cannot be CHANGED. The FOLLOWING settings are the only ones that can be changed in your site’s web.config file (s):
Many of the ASP.NET configuration options are not configurable at the site, application or subdirectory level on the shared hosting platform. Certain options can affect the security, performance and stability of the server and, therefore cannot be changed. The following settings are the only ones that can be changed in your site’s web.config file (s):
|
|
| 16. |
When Maintaining Session Through Sql Server, What Is The Impact Of Read And Write Operation On Session Objects? |
|
Answer» Maintaining state using DATABASE technology is a common practice when storing user-specific information where the information STORE is large. Database storage is particularly USEFUL for maintaining long-term state or state that must be PRESERVED even if the server must be restarted. Maintaining state using database technology is a common practice when storing user-specific information where the information store is large. Database storage is particularly useful for maintaining long-term state or state that must be preserved even if the server must be restarted. |
|
| 17. |
What Are The Disadvantages Of View State / What Are The Benefits? |
|
Answer» AUTOMATIC VIEW-state management is a feature of server controls that enables them to repopulate their property VALUES on a round trip (without you having to write any code). This feature does impact performance, however, SINCE a server control's view state is passed to and from the server in a hidden form field. You should be AWARE of when view state helps you and when it hinders your page's performance. Automatic view-state management is a feature of server controls that enables them to repopulate their property values on a round trip (without you having to write any code). This feature does impact performance, however, since a server control's view state is passed to and from the server in a hidden form field. You should be aware of when view state helps you and when it hinders your page's performance. |
|
| 18. |
What Is State Management In .net And How Many Ways Are There To Maintain A State In .net? What Is View State? |
|
Answer» Web pages are recreated each time the page is posted to the server. In traditional Web PROGRAMMING, this would ORDINARILY mean that all information associated with the page and the controls on the page would be LOST with each round trip. To overcome this inherent limitation of traditional Web programming, the ASP.NET page framework includes various options to help you preserve changes — that is, for managing STATE. The page framework includes a facility called view state that automatically preserves property values of the page and all the controls on it between round trips. However, you will probably ALSO have application-specific values that you want to preserve. To do so, you can use one of the state management options. Client-Based State Management Options:
Server-Based State Management Options
Web pages are recreated each time the page is posted to the server. In traditional Web programming, this would ordinarily mean that all information associated with the page and the controls on the page would be lost with each round trip. To overcome this inherent limitation of traditional Web programming, the ASP.NET page framework includes various options to help you preserve changes — that is, for managing state. The page framework includes a facility called view state that automatically preserves property values of the page and all the controls on it between round trips. However, you will probably also have application-specific values that you want to preserve. To do so, you can use one of the state management options. Client-Based State Management Options: Server-Based State Management Options |
|
| 19. |
What Are The Different Ways You Would Consider Sending Data Across Pages In Asp (i.e Between 1.asp To 2.asp)? |
| Answer» | |
| 20. |
What Method Do You Use To Explicitly Kill A Users Session? |
|
Answer» ABANDON() Abandon() |
|
| 21. |
What Is Cookie Less Session? How It Works? |
|
Answer» By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If COOKIES are not AVAILABLE, a session can be tracked by ADDING a session identifier to the URL. This can be ENABLED by setting the following: sessionstate cookieless="true"By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session identifier to the URL. This can be enabled by setting the following: |
|
| 22. |
Difference Between Asp Session And Asp.net Session? |
|
Answer» In Asp, the SESSION is PROCESS dependent, WHEREAS in In Asp, the session is Process dependent, whereas in |
|
| 23. |
Difference Between Application Events And Session Events |
|
Answer» The ASP.NET page framework provides ways for you to work with EVENTS that can be RAISED when your APPLICATION starts or stops or when an individual user's session starts or stops: Application Events are raised for all requests to an application. For example, Application_BeginRequest is raised when any Web Forms page or XML Web service in your application is requested. This event allows you to INITIALIZE resources that will be used for each request to the application. A corresponding event, Application_ EndRequest, provides you with an opportunity to close or otherwise dispose of resources used for the request. Session Events are similar to application events (there is a Session_OnStart and a Session_OnEnd event), but are raised with each unique session within the application. A session BEGINS when a user requests a page for the first time from your application and ends either when your application explicitly closes the session or when the session times out. The ASP.NET page framework provides ways for you to work with events that can be raised when your application starts or stops or when an individual user's session starts or stops: Application Events are raised for all requests to an application. For example, Application_BeginRequest is raised when any Web Forms page or XML Web service in your application is requested. This event allows you to initialize resources that will be used for each request to the application. A corresponding event, Application_ EndRequest, provides you with an opportunity to close or otherwise dispose of resources used for the request. Session Events are similar to application events (there is a Session_OnStart and a Session_OnEnd event), but are raised with each unique session within the application. A session begins when a user requests a page for the first time from your application and ends either when your application explicitly closes the session or when the session times out. |
|
| 24. |
What Is Method To Get Xml And Schema From Dataset? |
|
Answer» getXML () and getSchema () getXML () and getSchema () |
|
| 25. |
How To Check If A Datareader Is Closed Or Opened? |
|
Answer» IsClosed() IsClosed() |
|
| 26. |
In How Many Ways We Can Retrieve Table Records Count? How To Find The Count Of Records In A Dataset? |
|
Answer» Answer : foreach(DataTable thisTable in myDataSet.Tables){ // For each row, PRINT the VALUES of each COLUMN. foreach(DataRow myRow in thisTable.Rows){ |
|
| 27. |
What Happens When We Issue Dataset.readxml Command? |
|
Answer» READS XML SCHEMA and DATA into the DATASET. Reads XML schema and data into the DataSet. |
|
| 28. |
Explain Different Methods And Properties Of Datareader Which You Have Used In Your Project? |
| Answer» | |
| 29. |
What Are The Different Namespaces Used In The Project To Connect The Database? What Data Providers Available In .net To Connect To Database? |
|
Answer» System.Data.OleDb – classes that make up the .NET Framework Data Provider for OLE DB-compatible data sources. These classes allow you to connect to an OLE DB data source, execute commands against the source, and read the results. System.Data.SQLCLIENT – classes that make up the .NET Framework Data Provider for SQL Server, which allows you to connect to SQL Server 7.0, execute commands, and read results. The System.Data. SqlClient namespace is SIMILAR to the System.Data.OleDb namespace, but is optimized for access to SQL Server 7.0 and LATER. System.Data.ODBC - classes that make up the .NET Framework Data Provider for ODBC. These classes allow you to access ODBC data source in the managed space. System.Data.OracleClient - classes that make up the .NET Framework Data Provider for Oracle. These classes allow you to access an Oracle data source in the managed space. System.Data.OleDb – classes that make up the .NET Framework Data Provider for OLE DB-compatible data sources. These classes allow you to connect to an OLE DB data source, execute commands against the source, and read the results. System.Data.SqlClient – classes that make up the .NET Framework Data Provider for SQL Server, which allows you to connect to SQL Server 7.0, execute commands, and read results. The System.Data. SqlClient namespace is similar to the System.Data.OleDb namespace, but is optimized for access to SQL Server 7.0 and later. System.Data.Odbc - classes that make up the .NET Framework Data Provider for ODBC. These classes allow you to access ODBC data source in the managed space. System.Data.OracleClient - classes that make up the .NET Framework Data Provider for Oracle. These classes allow you to access an Oracle data source in the managed space. |
|
| 30. |
Difference Between Oledb Provider And Sqlclient ? |
|
Answer» SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is FAST. It's FASTER than the Oracle provider, and faster than accessing database via the OleDb layer. It's faster because it accesses the native library (which automatically gives you better PERFORMANCE), and it was written with LOTS of help from the SQL Server team. SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It's faster than the Oracle provider, and faster than accessing database via the OleDb layer. It's faster because it accesses the native library (which automatically gives you better performance), and it was written with lots of help from the SQL Server team. |
|
| 31. |
How Would You Connect To Database Using .net? |
|
Answer» SQLCONNECTION nwindConn = NEW SqlConnection("DATA Source=localhost; SqlConnection nwindConn = new SqlConnection("Data Source=localhost; |
|
| 32. |
Advantage Of Ado.net? |
Answer»
|
|
| 33. |
What's Different About Switch Statements In C#? |
|
Answer» No FALL-throughs ALLOWED. UNLIKE the C++ switch statement, C# does not support an explicit fall through from one case label to ANOTHER. If you want, you can use goto a switch-case, or goto default. No fall-throughs allowed. Unlike the C++ switch statement, C# does not support an explicit fall through from one case label to another. If you want, you can use goto a switch-case, or goto default. |
|
| 34. |
Is Goto Statement Supported In C#? How About Java? |
|
Answer» Gotos are supported in C# to the FULLEST. In Java goto is a RESERVED keyword that provides absolutely no FUNCTIONALITY. Gotos are supported in C# to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality. |
|
| 35. |
What Is The Difference Between Finalize And Dispose (garbage Collection) |
|
Answer» Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), DATABASE connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed EXTENSIONS for C++). The garbage collector calls this method at some point after there are no longer any valid references to the object. In some cases, you might want to provide programmers using an object with the ability to explicitly release these external resources before the garbage collector frees the object. If an external resource is scarce or expensive, better performance can be achieved if the PROGRAMMER explicitly releases resources when they are no longer being used. To provide explicit control, implement the Dispose method PROVIDED by the IDisposable Interface. The CONSUMER of the object should call this method when it is done using the object. Dispose can be called even if other references to the object are alive. Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), database connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed Extensions for C++). The garbage collector calls this method at some point after there are no longer any valid references to the object. In some cases, you might want to provide programmers using an object with the ability to explicitly release these external resources before the garbage collector frees the object. If an external resource is scarce or expensive, better performance can be achieved if the programmer explicitly releases resources when they are no longer being used. To provide explicit control, implement the Dispose method provided by the IDisposable Interface. The consumer of the object should call this method when it is done using the object. Dispose can be called even if other references to the object are alive. |
|
| 36. |
Overloaded Constructor Will Call Default Constructor Internally? |
|
Answer» NO NO |
|
| 37. |
I Have 3 Overloaded Constructors In My Class. In Order To Avoid Making Instance Of The Class Do I Need To Make All Constructors To Private? |
|
Answer» Yes Yes |
|
| 38. |
What Is Private Constructor? And It's Use? Can You Create Instance Of A Class Which Has Private Constructor? |
|
Answer» When a class declares only private instance CONSTRUCTORS, it is not possible for classes OUTSIDE the program to derive from the class or to directly create instances of it. (Except Nested classes) Make a constructor private if: - You want it to be available only to the class itself. For example, you might have a special constructor used only in the implementation of your class' Clone method. When a class declares only private instance constructors, it is not possible for classes outside the program to derive from the class or to directly create instances of it. (Except Nested classes) Make a constructor private if: - You want it to be available only to the class itself. For example, you might have a special constructor used only in the implementation of your class' Clone method. |
|
| 39. |
Difference Between Type Constructor And Instance Constructor? What Is Static Constructor, When It Will Be Fired? And What Is Its Use? |
|
Answer» (Class constructor method is also known as type constructor or type initializer) Instance constructor is executed when a new instance of type is CREATED and the class constructor is executed after the type is loaded and before any one of the type members is accessed. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class CONSTRUCTORS are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (VARIABLE argument) CALLING convention. A static constructor is used to initialize a class. It is called automatically to initialize the class before the first instance is created or any static members are referenced. (Class constructor method is also known as type constructor or type initializer) Instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention. A static constructor is used to initialize a class. It is called automatically to initialize the class before the first instance is created or any static members are referenced. |
|
| 40. |
Explain About Protected And Protected Internal, "internal" Accessspecifier? |
|
Answer» protected - Access is limited to the containing CLASS or TYPES derived from the containing class. protected - Access is limited to the containing class or types derived from the containing class. |
|
| 41. |
What Is Polymorphism? How Does Vb.net/c# Achieve Polymorphism? |
|
Answer» class Token class Token |
|
| 42. |
What Are Sealed Classes In C#? |
|
Answer» The sealed modifier is USED to PREVENT derivation from a class. A compile-time ERROR occurs if a sealed class is specified as the BASE class of ANOTHER class. (A sealed class cannot also be an abstract class) The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class) |
|
| 43. |
In Which Cases You Use Override And New Base? |
|
Answer» USE the new modifier to explicitly hide a member inherited from a BASE class. To hide an inherited member, declare it in the derived class USING the same NAME, and modify it with the new modifier. Use the new modifier to explicitly hide a member inherited from a base class. To hide an inherited member, declare it in the derived class using the same name, and modify it with the new modifier. |
|
| 44. |
You Have One Base Class Virtual Function How Will Call That Function From Derived Class? |
|
Answer» CLASS a class a |
|
| 45. |
Can We Call A Base Class Method Without Creating Instance? |
|
Answer» Its possible If its a static METHOD. Its possible If its a static method. |
|
| 46. |
What Is Method Overriding? How To Override A Function In C#? |
|
Answer» Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method OVERRIDDEN by an override declaration is known as the overridden base method. The overridden base method MUST have the same signature as the override method. You cannot override a non-virtual or STATIC method. The overridden base method must be virtual, abstract, or override. Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method. You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override. |
|
| 47. |
What Is Method Overloading? |
|
Answer» METHOD OVERLOADING occurs when a class contains two METHODS with the same name, but DIFFERENT signatures. Method overloading occurs when a class contains two methods with the same name, but different signatures. |
|
| 48. |
What Are The Oops Concepts? |
|
Answer» 1) ENCAPSULATION: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data. 2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that MAKE it UNIQUE within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors. 3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact NATURE of the situation. In general polymorphism means "one interface, multiple methods", This means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation. 1) Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data. 2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors. 3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods", This means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation. |
|
| 49. |
Can .net Framework Components Use The Features Of Component Services? |
|
Answer» Yes, you can USE the FEATURES and functions of Component SERVICES from a .NET FRAMEWORK component. Yes, you can use the features and functions of Component Services from a .NET Framework component. |
|
| 50. |
Is It True That Com Objects No Longer Need To Be Registered On The Server? |
|
Answer» Yes and No. LEGACY COM objects still need to be registered on the SERVER before they can be USED. COM developed using the new .NET Framework will not need to be registered. Developers will be able to autoregister these objects just by placing them in the 'bin' folder of the application. Yes and No. Legacy COM objects still need to be registered on the server before they can be used. COM developed using the new .NET Framework will not need to be registered. Developers will be able to autoregister these objects just by placing them in the 'bin' folder of the application. |
|