Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2004, 03:21 PM
Authorized User
 
Join Date: Feb 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error with SmallDateTime data type

Hi.

I'm working with an ASP.NET page that displays dates & times from a SQL Server 2000 database. The fields are formatted in both the ASP page & database to appear 'mm/dd/year'.

My problem is in updating the information. If any date / time field is blank, I get the following error: "System.FormatException: String was not recognized as a valid DateTime"

In the connection settings for the ASP.NET page, I have the input variable declared: Dim objUpdateContactParameter12 As New SqlParameter("@DateVerified", SqlDbType.SmallDateTime, 4)".

In the called stored procedure, the input varible is declared with "@DateVerified SmallDateTime" and the SET command orders the update "CntyDateVerified = @DateVerified".

In the database the field is set to accept NULL values.

What do I need to do to have the page pass a NULL value on to the database? Also, if you know of someplace where I can read up on this, I would really appreciate it.

Thank you.

 
Old November 22nd, 2004, 07:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:I'm working with an ASP.NET page
This is classic ASP forum. It is better to choose the relavant forum before posting. Try submitting this on a .NET forum here.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
data type error message Vince_421 Access VBA 3 June 11th, 2007 06:50 AM
Changing data type error kuku SQL Server 2000 1 August 18th, 2005 10:20 AM
Convert Char Data Type to smalldatetime rylemer SQL Language 3 March 3rd, 2005 03:13 PM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM
Data Type Mismatch error transcona Classic ASP Databases 4 June 25th, 2003 07:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.