CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies
ADO.NET Interview Questions & Answers - Learning Mode
COOLINTERVIEW.COM MICROSOFT INTERVIEW QUESTIONS ADO.NET INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE

ADO.NET Interview Questions & Answers - Learning Mode

ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed through OLE DB and XML. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update the databases.

Try ADO.NET Interview Questions & Answers - Exam Mode

Previous 1 2 3 4 5 Next

Sort By : Latest First | Oldest First | By Rating

ADO.NET Interview Questions & Answers - Learning Mode
Try ADO.NET Interview Questions & Answers - Exam Mode
Question: How do I insert records using data reader?

Answer: The procedure for updating records using INSERT commands is very similar to the one we presented in the previous example (of SELECT) except that here the command does not return anything and thus the method to call on the SqlCommand object is called ExecuteNonQuery().

C# Version

string connString = "server=FARAZ; database=programmersheaven;" +
"uid=sa; pwd=";
SqlConnection conn = new SqlConnection(connString);

// INSERT Query
string cmdString ="INSERT I Source: CoolInterview.com
Question: How do you declare a static variable and what is its lifetime? Give an example.

Answer: The static modifier is used to declare a static member, which belongs to the type itself rather than to a specific object. The static modifier can be used with fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs.
Source: CoolInterview.com
Question: How many records can take clustured index in sql server






Answer: THERE CAN BE AT THE MOST 1 CLUSTERED INDEX FOR ONE TABLE IN SQL SERVER Source: CoolInterview.com
Question: What are major difference between classic ADO and ADO.NET ?

Answer: ADO

ADO have recordset
ADO objects communicate in binary mode
ADO supports mostly connection oriented models
Since ADO derives information about data implicitly at run time based on metadata, it is an expensive process.
Only Client Side Cursors are allowed in ADO.
ADO.Net

ADO.Net have Data Adapter and Data set
ADO.NET uses XML for passing the data
ADO.Net works in Disconnected manner
By leveraging known meta data at design time, ADO.Net provide better runtim Source: CoolInterview.com
Question: What is the use of DataView?

Answer: Dataview is used for filtering and sorting data in a datatable.
//Code to sort by employee name in a data table
DataTable Employee = GetTable();
Employee.DefaultView.Sort = "Name"; Source: CoolInterview.com
Question: What are good ADO.NET object(s) to replace the ADO Recordset object?


Answer: he differences includes
In ADO, the in-memory representation of data is the Recordset.
In ADO.net, it is the dataset

A recordset looks like a single table in ADO
In contrast, a dataset is a collection of one or more tables in ADO.net

ADO is designed primarily for connected access
ADO.net the disconnected access to the database is used

In ADO you communicate with the database by making calls to an OLE DB provider.
In ADO.NET you communicate with the database th Source: CoolInterview.com
Question: What is a dataset?

Answer: A dataset is the local repository of the data used to store the tables and disconnected record set. When using disconnected architecture, all the updates are made locally to dataset and then the updates are performed to the database as a batch.
Source: CoolInterview.com
Question: What is the advantage of using stored procedure over the SQL queries?

Answer: Writing the SQL statements inside our code is usually not a good idea. In this way you expose your database schema (design) in the code which may be changed. Hence most of the time programmers use stored procedures instead of plain SQL statements. A stored procedure is a precompiled executable object that contains one or more SQL statements. Hence you can replace your complex SQL statements with a single stored procedure. Since, stored procedures are precompiled objects they execute faster at th Source: CoolInterview.com
Question: Why edit is not possible in repeater??



Answer: Repeater Control just reads the information from the database,so edit is not possible... Source: CoolInterview.com
Question: What is the Dot Net Framework data provider for SQL Server?

Answer: The dot net framework data provider for SQL Server is the optimized data provider for Microsoft SQL Server 7 or later. It is recommended to use SQL Server data provider to access the SQL Server DB than general provider like OLEDB. The classes for this provider are present in the System.Data.SqlClient namespace. Source: CoolInterview.com
Question: What is a data adapter?

Answer: A data adapter is the component that exists between the local repository (dataset) and the physical database. It contains the four different commands (SELECT, INSERT, UPDATE and DELETE). It uses these commands to fetch the data from the DB and fill into the dataset and to perform updates done in the dataset to the physical database. It is the data adapter that is responsible for opening and closing the database connection and communicates with the dataset. Source: CoolInterview.com
Question: Explain about ADO.NET and its features?

Answer: ADO.NET features are included in the Microsoft.NET framework. It has software components which help in data access and services. This can be used to make changes to RDBMS and non relational data base systems. This technology is considered to be the forefront of Active X data objects. Source: CoolInterview.com
Question: How do I read records from the data tables?

Answer: You can read the records from the data table using its Rows collection. With the Rows collection, you need to specify the row number and column name or number to access a particular field of the specified row. For example, if we have read the ?Student? table in our data table, we can access its individual fields as:
C# Version
DataTable dt = ds.Tables["student"];
string stId = dt.Rows[0]["StudentID"].ToString();
string stName = dt.Rows[0]["StudentName"].ToString();
string stDateOf Source: CoolInterview.com
Question: What is difference between Optimistic and Pessimistic locking?

Answer: Pessimistic locking is used when the user wants to update a record in a database and the user want to prevent other users from updating the same record. Other user?s can only view the data when there is pessimistic locking. Optimistic locking is used to improve concurrent operations on a record by allowing multiple users to update the same record. The record is only locked when updating the record. Optimistic locking has been widely used by web developers. Source: CoolInterview.com
Question: What is a Datatable object ?

Answer: Data Table is used to store the data retrieved from a database in application memory. Data table will have a set of data columns and data rows. Data table supports operations like adding, updating and deleting a row. Source: CoolInterview.com
Question: Why should one use a specialized data provider when the data can be accessed with general data providers?

Answer: The specialized data providers (e.g., SQL Server and Oracle) are built specially for a particular kind of DBMS and works much more efficiently than the general data providers (e.g., OLEDB and ODBC). In practice, the specialized data providers are many times efficient than the general data providers. Source: CoolInterview.com
Question: What is a database connection?

Answer: A database connection represents a communication channel between you application and database management system (DBMS). The application uses this connection to pass the commands and queries to the database and obtain the results of the operations from the database. Source: CoolInterview.com
Question: How do I create a command and supply the SQL query to ADO.Net? (Command object and command string)

Answer: First of all, you create a command object (SqlCommand, OracleCommand, OleDbCommand, OdbcCommand) using the connection object (SqlConnection, OracleConnection, OleDbConnection, OdbcConnection) and set its CommandText property to the SQL query to execute.

C# Version

OdbcCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from authors";



VB.Net Version

Dim cmd As OdbcCommand
cmd = conn.CreateCommand()
cmd.CommandText = "select * from authors" Source: CoolInterview.com
Question: What are the different components of ADO.Net?

Answer: ADO.Net also contains some database specific classes. This means that different database system providers may provide classes (or drivers) optimized for their particular database system. The provider for such classes are called the Dot Net Framework Data Providers. Microsoft itself has provided the specialized and optimized classes for their SQL server database system. The name of these classes start with ?Sql? and these are contained in System.Data.SqlClient namespace. Similarly, Oracle has als Source: CoolInterview.com
Question: How to find the given query is optimised one or not?



Answer: Using the power of the SQL Profiler and running a simple trace to capture the performance of your stored procedures can easily obtain these query lists. that needs tuning.

Source: CoolInterview.com

Previous 1 2 3 4 5 Next



India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.4375 Seconds