Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
TxtStartDate.Value = CDate("1/" & Today.Month & "/" & Today.Year)
TxtEndDate.Value = CDate(Date.DaysInMonth(Today.Year, Today.Month) & "/" & Today.Month & "/" & Today.Year)
loaddata()

What I have tried:

tried one solution but same
TxtStartDate.Value = CDate("1/" & Today.Month & "/" & Today.Year)
TxtEndDate.Value = CDate(Date.DaysInMonth(Today.Year, Today.Month) & "/" & Today.Month & "/" & Today.Year)
loaddata()
but same error
Posted
Updated 20-Jul-18 21:59pm

1 solution

Just create a new DateTime value and pass that to SQL:
VB
Dim now As DateTime = DateTime.Now
Dim year As Integer = now.Year
Dim month As Integer = now.Month 
Dim day As Integer = DateTime.DaysInMonth(year, month)
Dim dt As new DateTime(year, month, day)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900