We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Thursday, May 7, 2015

Interview questions and answers of ADO.NET



1. What is ADO.NET?

* It is an object-oriented technology given by Microsoft.
* it can be used for communication with data sources from .net enabled application.

2. What is DataSource?

*Datasource is nothing but where we can store the data and retrieve data for the application .
* We can use different data sources in the .net enabled applications...
*Data sources are a database, collection of objects, XML documents, and file system

3.what is the difference between connection-oriented architecture and disconnected architecture?

connection-oriented
(a)the application with establishing a connection with the database server
and it will be kept open and until the task has been completed

(b)for every operation of the database
we need to communicate with the database server so that traffic to the
the database server will be increased.
(c)parallel transactions will be easy
(d)fetching the data will be fast
(e)no memory management is required

disconnected
(a)the required data will be fetched into the dataset and the connection will be closed.
(b)the required data manipulations will be done on the tables into the dataset then changes will beat once so that traffic the database server can be reduced
(c)parallel transactions will be difficult
(d)fetching the data will be slow
(e)memory management is required for the dataset.

4.what is connection pooling?

*it is a set of open connections maintained by the application.
*whenever the application wants the connection to the database server it can take from the
Connection to the connection pool. Once the task has been completed the connection will be return
back to the connection pool, so that traffic to the database server can be reduced to open
a connection and close a connection.

5. Is the connection pool is part of the ADO.NET?

*NO, it is a separate algorithm that is implemented by the .net data provider.

6. Where we can provide the size of the connection pool?

*As a part of the connection string

7. What is the .NET Data Provider?

*it is a collection of classes which are implementing standard interfaces given by
Microsoft as a part of “System. Data" namespace.
*.NET Data providers are
(a)OLEDB .NET Data Provider
(b)SQLserver .NET Data Provider
(c)Oracle .NET Data Provider
(d)ODBC .NET Data Provider
(e)SQL Client .NET Data Provider

8.what is the .NET Data Provider used by the MySql?

*ByteFxData
*CoreLabs

9.how many types of classes are existing in the ADO.Net?

*Two types of classes are existing in the ADO.Net
they are
(a)connection-oriented classes:
*connection-oriented classes are designed as a part of the .net data provider.
*all the connection-oriented classes are designed according to the interfaces
given by Microsoft as a part of System. Data namespace.
*Connection-oriented classes are useful to communicate with different databases(local or remote)
EX:connection,command,DataReader,DataAdapter
(b)content-based classes:
*content-based class objects are used to hold the data that has been fetched
from different data sources.
*all the content-based classes designed as a part of System.Data namespace.
Ex: DataSet, DataTable, DataRow,DataColumn.

10. What is the connection object?

*connection object can be used to prepare the connection, open the connection and close the connection.

11.what is the connection string?

*it will provide complete information of the database server.

12.what is the properties of the connection object?

*ConnectionString:Specify connection string
*ConnectionTimeOut: time in seconds how long the code has to wait before generating an error if a connection can not be established
*DataBase:specify the name of database
*state:it gives state of connection(open,closed)

13.what are the methods of the connection object? (Optional)

*BeginTransaction()
*ChangeDatabase()
*Open()
*CreateCommand()
*Close()

14. What is the Command object?

*it can be used for preparation and submit SQL commands to the database engine

15.what are the properties of the command object?

*CommandText: specify the command in the form of text or stored procedure
*CommandType: text or stored procedure
*Connection:specify connection object
*CommandTimeOut: How long code has to wait before generating error report if the command can not be executed
*Parameters

16.which methods are submitting the command to the database engine?

*ExecuteReader():
this method can be used to submit the SQL statements to database engine.it will return one row
or more than one row from the database.
*ExecuteNonQuery():
this method can be used to submit the DML commands to the database engine. if the DML commands executed
successfully it will return '1' otherwise it will return '0'.
*ExecuteScalar():
this method can be used to submit the SQL statements to database engine.which can return a single value.

17. What is DataReader?

*DataReader object can be used to fetch records one by one from the network buffer.
*DataReader object can contain a single record at a time.

18. What is DataSet?

*DataSet is a virtual relational database. which contains tables and relations.
*Dataset is bidirectional navigation and manipulation.
*Dataset can be used for disconnected architecture why because it maintained the database tables without connecting the database.

19.what is the DataAdapter?

*it can be used for transmitting the data from the database to the dataset.
*Data Adaptorwinn does not perform storage, it will transmit the data only.

20.what is the diff between DataReader and DataSet?

*DataReader object can be used to fetch the records one by one from the network buffer whereas
DataSet object can be used to fetch all the records at a time from the network buffer
*DataReader object can contain a single record at a time.
Dataset object can contain multiple records at a time.

21.what is the difference between copy() and clone()?

*copy method will copy the structure and data of the table.
*clone method will copy the structure of the table.

22.what is the difference between close() and dispose()?

*connection close with the close method, it can be opened.
*connection close with dispose method, itcan not be opened.

23.what is the purpose of Fill()?

*automatically connection will be open and fetch the data from the database into the dataset.
once fetch the data has been completed automatically connection will be closed.

24.what are DataSource control?

*Datasource control is a programming component for connecting to different types of data.
*it acts as a mediator between databound[gridview,datalist,...] controls and data sources
*Datasource controls are:
(a)sqldatasource
(b)Linqdatasource
(c)Entitydatasource
(d)Objectdatasource
(e)Xmldatasource
(f)Sitemapdatasource

25.what are Rich Data controls?

*it can be used to present data to the user which is fetched from different data sources.
*Rich Data controls are.
(a)DataList control.
(b)DetailsView control.
(c)FormView control.
(d)GridView control.
(e)ListView control.

26.what is DataList control?

*it is introduced from asp.net 1.0.
*it is used to generate the reports according to requirements.
*Records can be shown to the user horizontally or vertically
*to bind the data with control we need to make use of templates.

27.what are the different types of templates available in the data list control?

*HeaderTemplate:
it is used to bind data with the header part of the datalist control.
*ItemTemplate:
it is used to bind data with the item in datalist control.
*AlternatingItemTemplate:
it is used to bind data with alternate items of datalist control.
*SeperateTemplate:
it is used to provide separator between items in datalist.
*FooterTemplate:
it is used to provide some footer to the datalist control.

28. What are the operations supported by DataList control?

*Edit, Delete.

29.what are the operations not supported by DataList Control?

*Paging, Insert.

30.what is DetailsView control?

*it is introduced from asp.net 2.0.
*No template design is required.
*all columns of the table will be automatically bound with details view control.

31. What are the operations supported by DetailsView control?

*insert,delete,update and paging.

32. What are the operations not supported by DetailsView control?

*sorting.

33.what is FormView control?

*is is introduced from asp.net 2.0.
*it needs a template to be designed to bind the data.
*it is similar to details view control.

34. What are the operations supported by FormView control?

*insert,delete,update and paging.

35. What are the operations not supported by FormView control?

*sorting.

36.what is GridView control?

*it is introduced from asp.net 2.0.
*it can present the information in the form of rows and columns.
*each row of gridview control is represented by gridview row object. all rows are maintained in the form of row collection.
*All columns of gridview controls are maintained in the form of columns collection.

37. What are the operations supported by GridView control?

*Edit,delete sorting and paging.

38. What are the operations not supported by GridView control?

*insert.

39.what are the field available in the gridview for customizing?

*BoundField:
This will display the text based on dataset table columns, this is default field
*TemplateField:
this allows placing webserver controls into gridview.
*ButtonField:
this provides a special type of buttons into gridview .
Ex:select,edit,delete
*ImageField:
this allows display image in gridview control.

40.what is ListView control?

*it is introduced from asp.net 3.5.
*it supports all operations that can be performed by using existing different rich data source controls.

41.What are the operations supported by ListView control?

*paging,sorting,insert,delete,update.

42.what is DataPager?

*it is used to design pagger setting for ListView control.

43.what is TreeView control?

*It is one of the site navigation control.
*Items in the Treeview control will be represented by using nodes collection.
*Each node will be representing by using TreeNode object.
*Each node can contain a number of other nodes as child nodes.
*All child nodes of node will be representing by using child nodes collection.

44.What is Menu control?

*it is a navigation control.We can maintain a number of items in the form of items collection.

45.what is Repeater control?

*it is not provided with built-in structure, the developer should provide structure using templates.

46.what is the difference between DataList and Repeater control?

*Datalist provides a number of templates compare to repeat.
*DataList supports more than one record in a row by providing
repeat column property.
The repeater is not supported.
*DataList provides style property to apply to format to templates information.
The repeater is not supported.
*Datalist rendering will be slow.
Repeater rendering will be faster, it provides better performance over datalist.

47.what is the purpose of the reading method?

*read method can be used to fetch the record from network buffer.

48.what is the diff b/w command obj and command builder obj?

*command object can be used to prepare the command and submit the SQL command to the database engine and the result set is given to the database engine and then send back to the application.
*command builder can prepare the SQL statements according to the operations done on the tables in the dataset and commands are assigned to the data adaptor.

No comments: