InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Customize paging in GridView/DataGrid/DataList/Repeater |
|
Answer» To customize paging in GridView we have to create a procedure which return the the EXACT result that we have set in GridView pagesize only we have to pass two parameter one is pageindex and SECOND is pagesize |
|
| 2. |
What DataReader class do in ADO.NET |
|
Answer» What DataReader class do in ADO.NET |
|
| 3. |
Export GridView to excel |
|
Answer» Below code is for GridView |
|
| 4. |
How to Clear or blank the GridView data? |
|
Answer» How to Clear or BLANK the GRIDVIEW data? |
|
| 5. |
Set table name in dataset |
|
Answer» To set NAME of table in DATASET first of all we have to bind the dataset with the database after this use Below syntax |
|
| 6. |
Code to apply distinct keyword record on dataset table |
|
Answer» Below code will help us to get the DISTINCT RECORDS from datatset tables |
|
| 7. |
Various methods to gernate xml by dataset object |
|
Answer» Below are the three methods to gernate xml by dataset OBJECTS:- |
|
| 8. |
What is connection pooling and its parameter |
|
Answer» When we are talking about application.Database connection is most important and resource buring task. Opening database connection is time consuming and may be verys slow task.Most of the applications need to execute any query on the database server, a connection need to be established. Connection pooling increases the performance of the applications by reusing the active database connections instead of create new connection for every request. |
|
| 9. |
How to do sorting of dataset after binding with dataset |
|
Answer» Below code helps us to do SORTING of data in dataset after fill data from database to dataset |
|
| 10. |
What is DataRelation with example in ADO.NET |
|
Answer» FIRST of all we have to understand what is DataRelation object in ado.net.when we have to set realtionship between two or more than two columns we use DataRelation class for that in ado.net. We we create an object of datarelation its enforce to do some constraints on the realtionship. That constraint can be Unique ,Foreiegn key. A DataRelation object permits to establish a parent-child relationship between two or more tables inside a DataSet object. The easiest way to create a DataRelation between two tables in a DataSet is to setup a primary key - foreign key relationship between the columns of a table. To Under stand it we take and example how to set realtion:- Dim Conn As SqlConnection Dim da As SqlDataAdapter Dim ds As DataSet Dim RowParent As DataRow Dim RowChild As DataRow 'below connection object is define in web.config file Conn = NEW _SqlConnection(ConfigurationSettings.Appsettings("StringInWeb.Config")) da = New SqlDataAdapter("SELECT * FROM Employees", Conn) ds = New DataSet() Try Conn.Open() da.Fill( ds,"Employees") da.SelectCommand = New SQLCOMMAND("SELECT * FROM Salary", Conn) da.Fill(ds, "Salary") Catch ex As SqlException Response.Write(ex.ToString()) Finally Conn.Dispose() END Try 'Next, Let us create a Data Relationship ds.Relations.Add("Employee_Salary", ds.Tables("Employees").Columns("EmployeeID"),ds.Tables("Salary").Columns("EmployeeID")) 'Display the Employee and Child Salary in the Form 'Say we have a Label in the form For each RowParent in ds.Tables("Employees").Rows lblRelation.Text &= RowParent("Emp_Name") For each RowChild in RowParent.GetChildRows("Employee_Salary") lblRelation.Text &= " " & RowChild("Sal_Amount") Next Next |
|
| 11. |
Define different execute methods of ADO.NET Command Object |
|
Answer» Define different execute METHODS of ADO.NET Command Object |
|
| 12. |
Getting Error DataControlRowType does not found in dotnet GridView? |
|
Answer» Getting Error DataControlRowType does not found in dotnet GridView? |
|
| 13. |
Connection and Disconnected Scenario in ADO.Net |
|
Answer» Connection-Oriented Scenario:- 1.Always accessing current data 2.Low NUMBER of concurrent data accesses 3.Many write accesses situation 4.IDbConnection, IDbCommand, IDataReader Disconnected Scenario: 1.MODIFICATION in DATASET is not EQUAL to modification in data source 2.Many concurrent read accesses situation 3.Dataset, Data table, DbDataAdapter |
|