Convert MySql Date/Time to Date/Time

I am pretty new to ASP.Net and to MySql.

I am receive the following error message when I try to retrieve a date field:

Unable to convert MySql date/time to System.DateTime

The message points to the following code:


What do I need to do so that I can read this date into my program.  It appears they two systems store dates differently, but I do not know enough about either to know where to begin.

Please help


2/17/2006 11:41:45 PM 1929 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 46

Is your issue like this one? Also try setting the "Allow Zero Datetime" = True in the ConnectionString.,47569,47569,13988,13988#msg-13988

Darrell Norton, MVP
Darrell Norton's Blog

Please mark this post as answered if it helped you!
2/19/2006 12:07:44 AM

Similar Artilces:

date/time or date and time
I am setting up an SQL database and I will need to get differences in dates. For example I have a start date, start time, completion date and completion time and I want to get the difference between the start and completion. Would it be better to have one field with both date and time in it, or better to have a date field and a time field? Even though I have already started setting up the tables with seperate fields for date and time I am now leaning toward one field with date/time in it. (Only because that is the way I had to do it when setting up an Excel spreadsheet for a similar ta...

Convert Date/Time to Date
Hi I'm using .NET 2.0 framework with a Postgres DB. I'm getting date values from the table 'creationdate' and I need to compare it with other date value (given by me). The thing is that tha date returned from the DB comes like this '27-03-2006 0:00:00' and the date value that I use to campare comes like this '27-03-2006'. I want to know how to convert the returned date value from the DB to date only...?! I tried using the following: SELECT CONVERT(char(10),creationdate,101) AS date FROM WHERE date = "myDate"; but it gives me an error: syntax error at or near "," at c...

java date time and utc date time
hi i have a client written in delphi the backend is written in java (webservice) when fetching a date field from the db, through java to delphi (TXSDateTime class), for some reason the date changes. in the db: 30/07/2009 00:00:00 in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before) in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before) i guess it's a matter of timezones but all we want is simply to fetch the same date as it appears in the DB what are we missing? thanks amos szust wrote: > hi > > i have a client written in d...

Unable to convert MySQL date/time value to System.DateTime
Hi I get the following error when i call my method from the class any ideas?  Unable to convert MySQL date/time value to System.DateTime Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTimeSource Error: Line 324: string strqry = "Select * FROM tblclients";Line 325:Line 326: DataTable returnD...

how to convert date time to just date
 Hi Guys,               I am pulling a date from the datatable the formate i am getting is like this 8/14/2008 12:00:00 AM  but i don't want to show time with it.  I know i can get this by doing something like this Format(trainingExpiry, 'dd/mm/yyyy') AS trainingExpiry  in my SELECT statement but i dont want to do this in my select statement.  I want to change date format in my C# code.  Can anyone tell me please how can i get the desired date formate.  thanks in advance. ALI&...

Unable to convert MySQL date/time value to System.DateTime #2
 Hi,        I am Mysql as database in C# web application.I am getting  TimeStamp field from mysql and convertusing cast.following statement i am using.CAST(SignupDate as DateTime) as SDate.Here SignupDate is Timestamp datatype.After I am convert SDate to shortdate.Following is the statement.  string strDate = Convert.ToString(Date);       DateTime sdate = DateTime.Parse(strDate);       string result;     return  sdate.ToString("d");After i am Bind the value t...

just Time or date portion of a date/time field
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, In code you could use Dim dt as System.Date Dim day, month, year as integer day = dt.Day month= dt.Month year = dt.Year This also works with DateTime In SQL you could use DATEPART(<datepart>,<datetime>) where <datepart> is the abbreviations mentioned in post 385301 and <datetime> is a...

MySQl date time problem
Iam using MySQL as database. When iam trying to fill dataset I got an error        An unhandled exception of type 'MySql.Data.Types.MySqlConversionException' occurred in        Additional information: Unable to convert MySQL date/time value to System.DateTime Please help Anz If this post was useful to you, please mark it as answer.ClientSideAsp.Net | Blog You may try the following fixes:

Date and Time in DOT NET.......
I'm working with a breaking system that needs to deals with Dates And times The problem is that it always bring me the date (ex: 27/7/2004) with the time (4:00:00 PM) I wont it to retrieve the time only? I tried this: Dim tFrom as Date - tFrom.ToLongTimeString - FormatDateTime(tFrom, DateFormat.LongTime) - FormatDateTime(tFrom.ToLongTimeString, DateFormat.LongTime) - Format(tFrom, "T") It brings to me a Full Date and Time like (23/7/2004 4:00:00 PM) I only wont the time (4:00:00 PM) Hi, Try this DateTime.Now.ToShortTimeString() ...

Adding time for past dates dates or correcting a time entry
Hi all, We are using Bugzilla to record time spent on bugs. Is there a way for a person to add time on a previous date? Or is there a way to correct an entry? I can access the DB by an ODBC connector, but I'm reluctant to change the date in bugs_activity table. Thanks Sanjay On Jul 29, 3:58=A0pm, Sanjay Jain <> wrote: > Hi all, > > We are using Bugzilla to record time spent on bugs. Is there a way for > a person to add time on a previous date? > > Or is there a way to correct an entry? > > I can access the DB by...

Compare file modified date time to system date time
I have an client application that uploads a zip file to a server. Once the server application sees the file, it processes the file. The process starts before the zip file is completely downloaded to the server. I want to delay the process until the file is completely downloaded. I am trying to compare the zip file modified date time with the system date time. If the zip file modified date time is 5 seconds older than the system date time then I know the zip file downloaded. At this point I will continue to process the zip file. I am not sure how I can compare the two date time. The DateTime....

Date entered...add time value to make date/time field
Windows XP Professional InfoMaker v 9.0.2 Build 7509 Our database contains a date/time stamp for when a specific activity happens to each shipment. I would like the users to be able to simply enter a date for a specific work day. I need to get a list of shipments where the time of one activity occurred on the entered date prior to 9:20. How can I create a computed field that will basically concatenate/amend the entered date with 9:20 that will later be used for criteria in returning rows? Thanks in advance for any help you can provide! Rita Palazzi Senior Engineer /...

just Time or date portion of date/time field: SOMEBODY PLS
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, When you pull in a SQL datetime column value into your .NET code, it is usually cast to a .NET DateTime type... something like this: System.DateTime TheDateAndTime = (System.DateTime)someDataReader["MySQLDateColumn"] Then you can use a variety of .NET methods included in the DateTime class to convert to a strin...

Server Date & Time vs. Local Date & Time
I have the following code (which some members assisted with) and it works great locally... It takes the date and time and formats just the way I want:  e.g.:  10/28/2008 13:58:44 becomes 102820080158 (which is what I want) But, when I upload the app to our server the date pulled is:           10/28/2008 1:59:37 PM As a result the date skips the formatting and does not work, so how can I code this so the date/time will be the same whether its local or on a server, and I have adjusted the regional settings to match - and same issue...

How to convert a date field to short date? without time.
I am using a query builder to buld a sql statement which brings me somes fields which are defined as date, and they are brought like this one: 5/17/2006 12:00:00 AM and I just want to bring the 5/17/2006.I tried CONVERT (CHAR(10), Fecha_evento, 101) AS Fecha_evento  It works, for displaying, but when I try to look for the maximun within that field, it interprets it as a string, so I do not get the right value.  Do you have a way to solve this? thanks a lot! There's really no such thing as a date without a time.  If you're having problems with displaying the information ...

Web resources about - Convert MySql Date/Time to Date/Time -

Resources last updated: 12/1/2015 2:43:29 AM