.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

How to Find Number of Days for provided date range?

Posted By :shah268     Posted Date :November 26, 2009    Points :10   Category :C# 
Code extract :

TimeSpan DayDifference = Convert.ToDateTime("2009-1-7").Subtract(Convert.ToDateTime("2009-1-1"));


To find the difference of the days, here we have used Subtract method. The Subtract method does not take start date into consideration. Hence, to get the exact number of days for the date range we need to add one more day to the result.

Response.Write("Number of Days : " + DayDifference.Days+1);

You can also find related Interview Question to How to Find Number of Days for provided date range?  below: 

How to find the last restart time and date of sql server?

  
First Check the recent error log
Then Check the creation of TempDb
Click Start and hit Run then type "Net Statistics server" in command prompt.
(More...)

How to find total number of tables in a database?

  

SELECT COUNT(*) AS [table count]
FROM [sys].[tables]

We can get the total number of tables using this query. (More...)

How to find the last backup time and date for particular database

  
step1: open enterprise manager

step2: select the particular database -->properties-->Now we are able to see last full,transaction log backup time and date (More...)

How to find number of items in the current session collection in ASP.NET

  
System.Web.SessionState.HttpSessionState member Count which returns the number of items in the current session collection (More...)

Minimum number of queues needed to implement the priority queue?

  
Two. One queue is used for actual storing of data and another for storing priorities. (More...)

What is Version Number in Assembly Manifest ?

  
A revision and build number in an assemblies is called Version Number.

There are Major and Minor Version number in an assembly. you can change this version number in assemblyinfo.cs file
usually version number looks like this in assemblyinfo.cs
1.0.*

The common language run time uses these numbers to enforce version policy. (More...)

How can we change priority and what the levels of priority are provided by .NET ?

  
Thread Priority can be changed by using Threadname.Priority = ThreadPriority.Highest. In the sample provided look out for code where the second thread is ran with a high priority.
Following are different levels of Priority provided by .NET :-
. ThreadPriority.Highest
. ThreadPriority.AboveNormal
. ThreadPriority.Normal
. ThreadPriority.BelowNormal
. ThreadPriority.Lowest (More...)

How many types of validation controls are provided by ASP.NET ?

  
There are six main types of validation controls:-

RequiredFieldValidator: It checks whether the control have any value. It's used when you want the control should not be empty.

RangeValidator: It checks if the value in validated control is in that specific range.

CompareValidator: It checks that the value in controls should match the value in other control.

RegularExpressionValidator: When we want the control value should match with a specific regular expression.

CustomValidator: It is used to define UserDefined validation.

ValidationSummary: It displays summary of all current validation errors. (More...)

What does this error mean:
System.ArgumentOutOfRangeException: Index was out of range : Upgrading CRM 3.0

  
Error Message : "System.ArgumentOutOfRangeException: Index was out of range", occurs while upgrading Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0

Solution : The problem occurs if an ampersand is in the subject of an activity that was created in a sales process or in a workflow rule. So, remove the ampersand.

To obtain this fix, use the Update Installation Files option during Microsoft Dynamics CRM 4.0 setup




For more details, visit http://kbalertz.com/Feedback.aspx?kbNumber=948917/ (More...)

How to get IP Number of a SYSTEM?

  
Request.UserHostAddress.ToString();
(or)
Request.UserHostName.ToString(); (More...)

Should validation (did the user enter a real date) occur server-side or client-side? Why?

  
Validation will be done in both sides i.e., at the server side and client side. Server side validation will be done even though client side validation performed on the code because of proper
security reasons. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend