Thursday, January 15, 2009

Interview Questions - Part 5

Interview Questions
------------------------

46. What is a command object?
a.) This is used to perform the required operations on the database. A command object contains 2 arguments. First argument specifies the sql statement or stored procedure to be executed on the database and second argument specifies the connection object. First argument, if it is a sql statement, it can be a select, update, insert or delete. If we want to use a stored procedure we should specify its name as the first argument of the command object. Command object is generally used along with the Data Reader.

47. Why we use ExecuteNonQuery method?
a.) This is the method of the connection object. This is used when you use a stored procedure. This won’t return any data from database, simply executes the procedure.

48. What is a DataAdapter?
a.) Dataset can’t communicate directly with the database. So, in order to communicate with the database it makes use of DataAdapter. This acts as a bridge between dataset and database. It contains 2 arguments. First argument specifies the sql statement , and 2 argument specifies the connection object. It can perform all the DML operations.

49. What is the method used by dataadapter to fill the dataset?
a.) It uses Fill() method to fill the dataset with data from database.

50. what are the differences between datareader and data adapter?
a.) DataReader:
1.It supports connected model
2.It is used to retrive a forward only read only stream of data from data source.
3.performance is more
4.It can not perform insert, delete or update operations
DataAdapter:
1.It supports Disconnected model
2.It acts as a bridge between dataset and database
3.performance is less when compared to datareader
4.It can perform insert, delete and update operations

51. How many templates are there in Repeater control?
a) 5 Templates are there
1. ItemTemplate
2. AlternatingItemTemplate
3. HeaderTemplate
4. FooterTemplate
5. SeparatorTemplate

52. What are the disadvantages of Repeater Control?
a )
1. It does not contain predefined layout.
2. It produces readonly output
3. It does not support user selection and editing of data
4. No inbuilt support for paging and sorting

53. How many templates are there in DataList Control
a ) 7 Templates
1. ItemTemplate
2. AlternatingItemTemplate
3. HeaderTemplate
4. FooterTemplate
5. SeparatorTemplate
6. SelectedItemTemplate
7. EditItemTemplate

54. What is the use of alternatingItem Template?
a ) This is used to apply alternate color scheme in Datareader and DataList server controls.

55. How many columns are there in DataGrid Control
a ) 5 columns
1. Bound Column
2. Button Column
3. Edit command column
4. Hyperlink Column
5. Templated Column

No comments:

Post a Comment