Pages

Tuesday, 18 December 2012

ADO.NET Interview Questions

What is Microsoft ADO.NET?
ADO.NET is one of the component in the Microsoft.NET framework which contains following features to Windows, web and distributed applications.
i. Data Access to the applications from Database in connected (Data reader object) and disconnected (Data set and data table) model.
ii. Modify the data in database from application.
What are the Benefits of ADO.Net?
ADO.Net offers following Benefits
Interoperability:
XML Format is one of the best formats for Interoperability.ADO.NET supports to transmit the data using XML format.
Scalability:
ADO.NET works on Dataset that can represent a whole database or even a data table as a disconnected object and thereby eliminates the problem of the constraints of number of databases being connected. In this way scalability is achieved.
Performance:
The performance in ADO.NET is higher in comparison to ADO that uses COM marshalling.
Programmability:
ADO.Net Data components in Visual studio help to do easy program to connect to the database.
Explain different connection objects used in ADO.NET?
Sqlconnection object used to connect to a Microsoft SQL Server database. SQL database connections use the SqlDataAdapter object to perform commands and return data.
OracleConnection object used to connect to Oracle databases. Oracle database connections use the OracleDataAdapter object to perform commands and return data. This connection object was introduced in Microsoft .NET Framework version 1.1.
OleDbConnection object used to connect to a Microsoft Access or third-party database, such as MySQL. OLE database connections use the OleDbDataAdapter object to perform commands and return data.
What are the different steps to access a database through ADO.NET?
  • Create a connection to the database using a connection object.
  • Open the Database Connection.
  • Invoke a command to create a Dataset object using an adapter object.
  • Use the Dataset object in code to display data or to change items in the database.
  • Invoke a command to update the database from the Dataset object using an adapter object.
  • Close the database connection.
What is the difference between Data Reader and Data Adapter?
  • Data Reader is read only forward only and much faster than Data Adapter.
  • If you use Data Reader you have to open and close connection explicitly where as if you use Data Adapter the connection is automatically opened and closed.
  • Data Reader  expects connection to database to perform any operation on data where as Data Adapter is disconnected
What is the difference between Execute Reader, Execute Scalar and Execute Non Query methods?
Execute Reader
Execute Reader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object.
Execute Scalar
Execute Scalar will be used to return the single value, on execution of SQL Query or Stored procedure using command object.
Execute Non Query
If the command or stored procedure performs INSERT, DELETE or UPDATE operations, then we use Execute Non Query method. Execute Non Query method returns an integer specifying the number of rows inserted, deleted or updated.

Read more: ado.net interview questions and answers for freshers | FreeJobAlert.com http://www.freejobalert.com/ado-net-interview-questions/10231/#ixzz2FODWpXOr

ASP.Net Interview Question and Answers

What is ASP.NET?
  ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.
ASP.NET provides increased performance by running compiled code.
2. What is the difference between Classic ASP and ASP.Net?
 
    ASP is Interpreted language based on scripting languages like Jscript or VBScript.
  • ASP has Mixed HTML and coding logic.
  • Limited development and debugging tools available.
  • Limited OOPS support.
  • Limited session and application state management.
  • ASP.Net is supported by compiler and has compiled language support.
  • Separate code and design logic possible.
  • Variety of compilers and tools available including the Visual studio.Net.
  • Completely Object Oriented.
  • Complete session and application state management.
  • Full XML Support for easy data exchange.
3. What is Difference between Namespace and Assembly?
  Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.
4. What is the difference between early binding and late binding?
  Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.
5. What is the difference between ASP Session State and ASP.Net Session State?
  ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.
6. What is the difference between ASP Session and ASP.NET Session?
  Asp.net session supports cookie less session & it can span across multiple servers.
7. What is reflection?
  All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.
The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.
8. What is the difference between Server.Transfer and response.Redirect?
  The Server.Transfer () method stops the current page from executing, and runs the content on the specified page, when the execution is complete the control is passed back to the calling page.
While the Response.Redirect () method transfers the control on the specified page and the control is never passed back to calling page after execution.

Java Interview Questions

Question: What is the difference between an Interface and an Abstract class?
  Question: What is the purpose of garbage collection in Java, and when is it used?  
Question:  Describe synchronization in respect to multithreading.
Question:  Explain different way of using thread?  
Question:  What are pass by reference and passby value?
Question:  What is HashMap and Map?
Question:  Difference between HashMap and HashTable?
Question: Difference between Vector and ArrayList?
Question:  Difference between Swing and Awt?
Question:  What is the difference between a constructor and a method?
Question:  What is an Iterator?
Question:  State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
Question: What is an abstract class?
Question: What is static in java?
Question:
What is final?