473,473 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Saving a date

get the following error when I try to save a date:

When converting a string to DateTime, parse the string to take the date
before putting each variable in the DateTime object.

I was using a calendar control thinking that might have been the problem so
I am using just a text box for entry. In the ASP code for the Insert
statement, I have this:
<asp:controlParameter Name="InDate" Type="DateTime" ControlID="txtInDate" />
I have double checked the SQL table to make sure that the field is DateTime
and it is. Also, if I have not selected a date or the textbox contains no
information then it does not error and just saves the field blank.
What do I need to do to store this date?

Thanks for the information.

Dec 1 '05 #1
2 1394
You can do it this way....
Dim myDate as Date = Date.parse(txtInDate.text)

Dec 1 '05 #2
I have been working most of today trying to figure out this date problem
because that was in the error message, only to discover that is was NOT a
date problem, but another field that is set to type decimal had a control
parameter from a label (text). So what I did is to convert the text to
double, store it in a session variable and then set the parameter to the
session variable and voila!

"Brad" wrote:
get the following error when I try to save a date:

When converting a string to DateTime, parse the string to take the date
before putting each variable in the DateTime object.

I was using a calendar control thinking that might have been the problem so
I am using just a text box for entry. In the ASP code for the Insert
statement, I have this:
<asp:controlParameter Name="InDate" Type="DateTime" ControlID="txtInDate" />
I have double checked the SQL table to make sure that the field is DateTime
and it is. Also, if I have not selected a date or the textbox contains no
information then it does not error and just saves the field blank.
What do I need to do to store this date?

Thanks for the information.

Dec 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

138
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday, April 6th, 2004 @ 01:49PM from the...
4
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+....
4
by: Michael Pfeifer | last post by:
Hi all, I need to convert datetimes from any timezone to UTC and back considering daylight saving. It is not enough, to just add or subtract the timezone offset. Also, I can not use c functions...
1
by: viki.sanjeeva | last post by:
Hi, There is a date field in JSP form where user will enter date in dd-mm-yyyy format. Now before saving into DB2, I want to validate the date format against dd-mm-yyyy format and then save into...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
0
by: Chirag Shukla | last post by:
Colleagues, I wanted to share a function to find if a date is in Daylight Saving Time or not. I was able to make this function faster than reading MSDN to find functions that .NET provides. I...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
2
by: jessDMiller | last post by:
I have no clue why the data from the form isn't saving into the database. What am I doing wrong? addAnnounce.php: <td align=top> <form action="index2.php" method="post">Heading:<br...
27
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have a web application that will be hosted on servers with timezones configured to EST with daylight saving. My application takes an XML datafeed that contains times in GMT (also with...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.