473,387 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HoW To DeClaRE VaLUe FrOM TeXT BoX To DaTE FoRMaT

1
Dim DatTim1 As Date = #12/1/2007#
Dim DatTim2 As Date = #12/1/2007#

Dim WD As Long = DateDiff(DateInterval.Day, DatTim1, DatTim2)
Me.totalCount.Text = WD + 1


I used the code above to calculate date interval between two date. but, i dont want to declare DatTim1 & DatTim2 as a constants value. Because i want the user to key in the values in the text box. how can i declare the value from the text box to the DatTim1 & DatTim2?
Sep 26 '07 #1
1 1137
Shashi Sadasivan
1,435 Expert 1GB
Dim DatTim1 As Date = #12/1/2007#
Dim DatTim2 As Date = #12/1/2007#

Dim WD As Long = DateDiff(DateInterval.Day, DatTim1, DatTim2)
Me.totalCount.Text = WD + 1


I used the code above to calculate date interval between two date. but, i dont want to declare DatTim1 & DatTim2 as a constants value. Because i want the user to key in the values in the text box. how can i declare the value from the text box to the DatTim1 & DatTim2?
Expand|Select|Wrap|Line Numbers
  1. DateTime dt1 = Convert.toDateTime(textBox1.text);
Hope you can convert it to C#

cheers
Sep 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Boyd Reilly | last post by:
I have a form that has the user pick the type of question he will answer. The input field will be a text, numeric or date type. So, after the question is answered, I need to change the input...
1
by: luna | last post by:
getting this error - i think its because im trying to put english date format into american date format (asp to sql server 2000) im getting the date using mortsourcedlabel.Text = Date.Today...
2
by: Benedict Teoh | last post by:
I created a dropdownlist containing day, month and year field and expose a property to assign a date. When I call from a aspx page and assign the value, the new date is not displayed until a submit...
15
by: JenHu | last post by:
Hi expert, I have a data field (birthdate) contains a datetime datatype (mm/dd/yyyy), how can I convert to mmdd?? say, the birthday is 8/1/1979 and convert to mmdd DOB =...
1
by: abcabcabc | last post by:
I write an application which can let user define own date format to input, How to convert the date string to date value with end-user defined date format? Example, User Defined Date Format as...
11
by: Dixie | last post by:
How can I programatically, take some Date/Time fields present in a table in the current database and change their type to text? dixie
0
by: Seok Bee | last post by:
Dear Experts, I am having a wizard control in my web app. I have some textbox controls within the wizard control. At the same time, I have a hyperlink to run a pop-up window for calendar. The...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
3
by: Mo | last post by:
Hi, I am trying to grab the text value of a text box in a formview. I know how to do it the long way using findcontrol but I have a few textboxes in the control and I am looking for a one liner...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.