1. Explain Advantages of ADO.Net?

Ado.net uses dataset for accessing the data , since the dataset is created in client side there is no need of connection at the time of working on dataset ,to the server(where the database is present), so this makes the data accessing faster mainly in the net environment.

rs:
Ado.net uses dataset for accessing the data , since the dataset is created in client side there is no need of connection at the time of working on dataset ,to the server(where the database is present), so this makes the data accessing faster mainly in the net environment.

2. How to add a check box or a dropdown list to a column in a datagrid?

By using template column, as

<asp:TemplateColumn>

<asp:ItemTemplate>

<asp:CheckBox></asp:CheckBox>

<asp:DropDownList></asp:DropDownList>

</asp:ItemTemplate>

</asp:TemplateColumn>

3. What is difference in Record set and Dataset?

Data Reader worked as conventional Record Set of VB but Data Set Can store a complete database with all the relations and constraints.

Data Reader worked in Read only where as Data Set provide u the flexibility of Updating data also.

Data Reader worked in connected mode only, whereas Data set works in disconnected mode also.

Recordset is a collection of records returned by the query.

Dataset is merely a collection of tables.

4. How to identify the updated rows in a dataset?

If the RowState property of the DataRow is "Modified" then that DataRow can be treated as updated.

If dr.RowState=DataRowState.Modified then
' u r logic here
End if

5. What is difference between ado and ado.net?

ADO and ADO.NET are different in several ways:

ADO works with connected data. This means that when you access data, such as viewing and updating data, it is real-time, with a connection being used all the time. This is barring, of course, you programming special routines to pull all your data into temporary tables.

ADO.NET uses data in a disconnected fashion. When you access data, ADO.NET makes a copy of the data using XML. ADO.NET only holds the connection open long enough to either pull down the data or to make any requested updates. This makes ADO.NET efficient to use for Web applications. It's also decent for desktop applications.

ADO has one main object that is used to reference data, called the Recordset object. This object basically gives you a single table view of your data, although you can join tables to create a new set of records. With ADO.NET, you have various objects that allow you to access data in various ways. The DataSet object will actually allow you to store the relational model of your database. This allows you to pull up customers and their orders, accessing/updating the data in each related table individually.

ADO allows you to create client-side cursors only, whereas ADO.NET gives you the choice of either using client-side or server-side cursors. In ADO.NET, classes actually handle the work of cursors. This allows the developer to decide which is best. For Internet development, this is crucial in creating efficient applications.

Whereas ADO allows you to persist records in XML format, ADO.NET allows you to manipulate your data using XML as the primary means. This is nice when you are working with other business applications and also helps when you are working with firewalls because data is passed as HTML and XML.

6. Explain all the classes those are used for database connections between sql server and asp.net?

1.SqlClientPermission - Enables the .NET Framework Data Provider for SQL Server to help ensure that a user has a security level adequate to access a data source.

2.SqlClientPermissionAttribute - Associates a security action with a custom security attribute.

3. SqlCommand - Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.

4.SqlCommandBuilder - Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated SQL Server database. This class cannot be inherited.

5. SqlConnection - Represents an open connection to a SQL Server database. This class cannot be inherited.

6.SqlDataAdapter - Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database. This class cannot be inherited.

7.SqlDataReader - Provides a means of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.

8.SqlError - Collects information relevant to a warning or error returned by SQL Server. This class cannot be inherited.

9.SqlErrorCollection - Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.

10.SqlException - The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.

11.SqlInfoMessageEventArgs - Provides data for the InfoMessage event. This class cannot be inherited.

12.SqlParameter - Represents a parameter to a SqlCommand, and optionally, its mapping to DataSet columns. This class cannot be inherited.

13.SqlParameterCollection - Represents a collection of parameters relevant to a SqlCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited.

14.SqlRowUpdatedEventArgs - Provides data for the RowUpdated event. This class cannot be inherited.

15.SqlRowUpdatingEventArgs- Provides data for the RowUpdating event. This class cannot be inherited.

16. SqlTransaction - Represents a Transact-SQL transaction to be made in a SQL Server database. This class cannot be inherited.

7. Explain the difference in Record set and Dataset?

Data Reader worked as conventional Record Set of VB but Data Set Can store a complete database with all the relations and constraints.

Data Reader worked in Read only where as Data Set provide u the flexibility of Updating data also.

Data Reader worked in connected mode only, whereas Data set works in disconnected mode also.

Recordset is a collection of records returned by the query.

Dataset is merely a collection of tables.

8. Explain the Differences between OLEDB SQL SERVER, OLEDBDOTNET PROVIDER?

OleDBDotNet Provider can be used to connect to any DataSource but OleDb SQL SERVER can be used to connect only to a SQL Server DataSource.

9. How to identify the controls which can be used for binding data?

Control which drives from BaseDataBoundControl Class

Serves as the base class for controls that bind to data using an ASP.NET data source control.

10. Explain How to bind the controls(best practice) comboboxes to the data in the dataset?

DropDownList1.DataSource=Myds;
DropDownList1.DataTextField = "FieldName";
DropDownList1.DataValueField = "FieldName";

Download Interview PDF