C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Visual Studio »

Compare from-date and to-date


Posted Date: 02 May 2009    Resource Type: Articles    Category: Visual Studio
Author: Srujana TechnologiesMember Level: Bronze    
Rating: 1 out of 5Points: 5



When we want to get data between some specified dates.Follow the following method to compare dates.we have to get data from small date to big date (EG: from 01-01-2009 to 02-05-2009 but not 02-05-2009 to 01-01-2009).
When wrong dates are selected we have to warn the user to select valid dates.

Following is the code for comparign dates

private sub check_date()
Dim cdat1, cdat2 As Date
cdat1 = CType(txtFrom.Text, Date)
cdat2 = CType(txtTo.Text, Date)
If cdat1.CompareTo(cdat2) > 0 Then
MessageBox.Show("Please select valid dates")
Exit Sub
End If
end sub



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Pls give this code in c#  .  Date validation  .  Date Comparison in VB.Net  .  Date Comparision  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Calling Similar Methods of two Interfaces from a Class.
Previous Resource: Installing Visual Studio.Net On winows 2000 advanced server
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use