TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chris Johnson
NA
67
32.3k
DateTimePicker convert error. Cannot convert to Long.
Jun 5 2013 10:24 AM
Hello all,
I have code to convert a datetime to a week number, however I have the following error.
Argument 1: cannot convert from 'System.Windows.Forms.DateTimePicker' to 'long'
I understand I need to set a parameter on the datetimepicker, however, I have had a long day and just cannot figure it out. Could someone please help me? The code is very simple.
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
var currentCulture = CultureInfo.CurrentCulture;
var weekNo = currentCulture.Calendar.GetWeekOfYear(
new DateTime(dateTimePicker1),
currentCulture.DateTimeFormat.CalendarWeekRule,
currentCulture.DateTimeFormat.FirstDayOfWeek);
}
Reply
Answers (
3
)
checking if id and reg already exists
application