CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 8/15/2005 1:43:01 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 7 Views: 46 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
8 Items, 1 Pages 1 |< << Go >> >|
ad_flying
Asp.Net User
String was not recognized as a valid DateTime8/15/2005 1:43:01 AM

0/0

I use a FormView to edit data, there is a DateTime filed.

The original for the DateTime filed  is null and the user did not enter any date into it.
It result into a run time error: "DateTime String was not recognized as a valid DateTime" when update.

How can I set the data time filed to null in this situation?

ByReckon
Asp.Net User
Re: String was not recognized as a valid DateTime8/15/2005 8:56:05 PM

0/0

Hello ad_flying,

have you tried to set your datetime string equals to a DbNull value in the editing event of your FormView?

VB .Net Coder - Apologize my C# nescience
Best Regards.
timlshu
Asp.Net User
Re: String was not recognized as a valid DateTime8/16/2005 4:41:03 AM

0/0

That is an error code you are getting from the Sql server. Open the table in the Sql server and check the "allow nulls" for that column. That way when the database gets no date, it wont care.

xiaoweib
Asp.Net User
Re: String was not recognized as a valid DateTime12/3/2007 4:55:18 AM

0/0

I have same problem.  

before my code is like this:

Dim NewTagName12 As String = (CType(GridView1.Rows(e.RowIndex).Cells(12).Controls(0), TextBox)).Text 

the error message is "DateTime String was not recognized as a valid DateTime" when update.

then I change to:

Dim NewTagName12 As String = Date.ParseExact(CType(GridView1.Rows(e.RowIndex).Cells(12).Controls(0), TextBox).Text(), "MM/dd/yy", New Globalization.DateTimeFormatInfo)

the error message is : "String was not recognized as a valid DateTime." when update.

does somebody know how to change this code? 

 

 

bab_ganesh
Asp.Net User
Re: String was not recognized as a valid DateTime12/3/2007 5:21:56 AM

0/0

Hi,

You may convert the field value into DateTime in you code behind. Convert the Field value if the field have any valid date otherwise dont convert.

Convert.ToDateTime("") -> throws Error.

Ganesh

 

xiaoweib
Asp.Net User
Re: String was not recognized as a valid DateTime12/3/2007 3:06:36 PM

0/0

thank  u for your answer. the field value is already DateTime, the problem is if a datetime field is blank. then it will give error message when update, if  datetime field  have date there, it won't show the error message.

about this code below how can I change the code so it will check if the field is blank ,then just skip this field and doesn't need to do anything. 

Dim NewTagName12 As String = Date.ParseExact(CType(GridView1.Rows(e.RowIndex).Cells(12).Controls(0), TextBox).Text(), "MM/dd/yy", New Globalization.DateTimeFormatInfo)

xiaoweib
Asp.Net User
Re: String was not recognized as a valid DateTime12/3/2007 11:24:04 PM

0/0

I checked this date field to  "allow nulls" , but it doesn't work.

xiaoweib
Asp.Net User
Re: String was not recognized as a valid DateTime12/4/2007 11:15:29 PM

0/0

I have the same problem,does someone know how to fix it?

8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
Pro Windows PowerShell Authors: Hristo Deshev, Pages: 493, Published: 2008
ASP.NET 2.0 All-In-One Desk Reference For Dummies: all-in-one desk reference for dummies Authors: Doug Lowe, Jeff Cogswell, Ken Cox, Pages: 910, Published: 2006
Developing Killer Web Apps with Dreamweaver MX and C# Authors: Chuck White, Pages: 409, Published: 2004
Fundamentals of Web Applications Using .NET and XML Authors: Eric Bell, Pages: 564, Published: 2002
Oracle PL/SQL Programming Authors: Steven Feuerstein, Bill Pribyl, Pages: 1171, Published: 2005
Debugging SAS Programs: A Handbook of Tools and Techniques Authors: Michele M. Burlew, Pages: 354, Published: 2001
Visual Basic 2005: The Complete Reference Authors: Ron Petrusha, Pages: 874, Published: 2006
Zope: Web Application Development and Content Management Authors: Steven Spicklemire, Kevin Friedly, Kim Brand, Pages: 454, Published: 2002
The Definitive Guide to MySQL 5 Authors: Michael Kofler, David Kramer, Pages: 748, Published: 2005

Web:
'String was not recognized as a valid DateTime _openDate = DateTime.Parse(Request.Form["openDate"]); I get error saying 'String was not recognized as a valid DateTime' thanks in advance ...
Error: String was not recognized as a valid DateTime - ASP.NET Forums Whenever I click on a 'monthly archive' link I receive the error 'String was not recognized as a valid DateTime. ...
'String was not recognized as a valid DateTime Talk about 'String was not recognized as a valid DateTime.
String was not recognized as a valid DateTime - .NET ASP String was not recognized as a valid DateTime. Get answers to your questions in our .NET ASP forum.
String was not recognized as a valid DateTime. - ASP.NET Forums String was not recognized as a valid DateTime. Last post 11-22-2007 11:55 PM by nthillaiarasu. 14 replies. Sort Posts: ...
Error:"String was not recognized as a valid DateTime". - DevX.com ... Error:"String was not recognized as a valid DateTime". ASP.NET.
"String was not recognized as a valid DateTime." : valid, string DataView view = new DataView(data.syn_vAllActions); view.RowFilter = heure_rdv>= # + celldate1.ToString() + # and heure_rdv<# + celldate2.ToString() + # and.
String was not recognized as a valid DateTime. (DayPilot Forums) String was not recognized as a valid DateTime. I am receiving the following error when attemping to run a page with the Scheduler control on ...
String was not recognized as a valid DateTime. [Archive] - Frunder ... [Archive] String was not recognized as a valid DateTime. Help & Installation.
Formatting Dates in ASP.NET / String was not recognized as a valid ... NET / String was not recognized as a valid DateTime. ... Formatting Dates in ASP .NET / String was not recognized as a valid DateTime ...




Search This Site:










problem running multiple databases from a single web app

protect image files?

help with document formatting

creating new module with dnn3

unable to update or delete a doc category

windows authentication with role in db

what is ilist ?

javascript intellisense for virtual earth sdk

can a container be made invisible?

runtime error! abnormal program termination

questions about custom membershipprovider

document: how to debug a custom module

multiple selection on dropdown list

where to store secure information???

retrieve email of user logged in

where does my text go!

how to remotely identify asp.net version

unable to read the project file 'xxx.vbproj'. the system can not find the file specified.

regular expression help

from c# tp vb.net

setting for brackets...

contentplaceholder in master page won't stay in same position

cool links and links page

vbscript for client side scripting?

selectedvalue vs. selecteditem.value

toolbar menu from the ie web control package

backup database

solpart menu how to add a leftseparater and rightleftseparator image?

free skin announcements and follow ups

namespace grief - why?

 
All Times Are GMT