What is Dataset object?
Databases
|
DataProviders
|
DataAdapters
|
DataSets
|
DataProviders
|
DataAdapters
|
DataSets
The DataSet is an in-memory cache of data retrieved from a data source. It consists of a collection of DataTable objects. These DataTables can be related to eachother with the help of DataRelation objects.
DataSet object can not directly interact with Database. A DataAdapter object needs to be created to refer to the connection that is created.
What are the various objects in Dataset?
The DataSet class exists in the System.Data namespace. The Classes contained in the DataSet class are:
DataTable
DataColumn
DataRow
Constraint
DataRelation
DataColumn
DataRow
Constraint
DataRelation
How to save data from dataset?
The modified data needs to be sent back to the database in order to save it. Therefore, to send the modified data to a database, the Update method of a TableAdapter or data adapter needs to be called. The Update method executes either of INSERT, UPDATE, or DELETE depending on the RowState in the table.
In Visual Studio a TableAdapterManager component is used for saving the proper order based on the foreign-key constraints of the database.
Although the procedure to save the data may change depending upon the applications, the following steps throw light on the generalized concept:
The code sends updates to the database should be written within a try/catch block.
The data row should be located to determine the problem area and the code should then be reattempted.
Explain the difference between dataset clone and dataset copy?
Dataset.clone() duplicates (only) the structure of a dataset, without duplicating the data.
Dataset.copy() performs a deep copy of the dataset.
Explain the difference between DataSet and DataReader
Datareader fetches one row at a time from the datasource. DataSet fetches all data from the datasource at a time to its memory area.
Datareader is like a forward only recordset. We can traverse through an object in a DataSet to get required data.
How do we step through code?
Stepping through the code is a way of debugging the code in which one line is executed at a time. There are three commands for stepping through code:
Step Into: This debugging mode is usually time-consuming. However, if one wants to go through the entire code then this can be used. When you step into at a point and a function call is made somewhere in the code, then step into mode would transfer the control to the first line of the code of the called function.
Step Over: The time consumed by the Step into mode can be avoided in the step over mode. In this, while you are debugging some function and you come across another function call inside it, then that particular function is executed and the control is returned to the calling function.
Step Out: You can Use Step Out when you are inside a function call and want to return to the calling function. Step Out resumes execution of your code until the function returns, and then breaks at the return point in the calling function.
What are the debugging windows available?
The windows which are available while debugging are:
Breakpoints, Output, Watch, Autos, Local, Immediate, Call Stacks, Threads, Modules, Processes, Memory, Disassembly and Registers.

0 Comments:
Post a Comment