| What is the Code Render blocks in ASP.Net? |
| A Code Render block is block of code that: 1. is inline, interspersed with your HTML contents. 2. can execute code anywhere on the page as opposed to only in the script block. 3. Used <% .... %> as the delimeters. |
|
|
|
|
|
| What method do you use to explicity kill a user's session? |
| The Session.Abandon() method destroyed the object stored in a Session object and releases their resources. If you do not call the Abandon method explicity, the server detroys these objects when the session times out. |
|
|
|
|
|
| Which method do you use to re-direct the user to another page without performing a round trip? |
| Server.Transfer(); method. |
|
|
|
|
|
| How To Find Number of Days between two Dates in C# Asp.Net? |
| To calculate the number of days between two dates in Asp.Net using C#, use the below piece of code.
TimeSpan timespan = Convert.ToDateTime("2009-12-31").Subtract(Convert.ToDateTime("2009-01-01"));
Response.Write(timespan.Days+1);
Here we use Subtract method to find the difference between two dates. Usually the Subtract method return a value that is one less than the correct value. So to the Timespan object Days property we can add 1 to get the exact number of days. |
|
|
|
|
|
| How many objects does ADO.Net have and what are they? |
There are 5 objects in ADO.Net.
They are Connection, Adapter, Command, Reader and Dataset. |
|
|
|
|
|
| Which namespace do you include while using ODBC connectivity? |
| System.Data.ODBC; |
|
|
|
|
|
| Which Versions of the .NET Framework Support Generics? |
| Generics are only supported on version 2.0 and above of the Microsoft .Net framework, as well as version 2.0 of the compact framework. |
|
|
|
|
|