473,498 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySql DateTime

Hi,

I'm trying to use MySql 4.1 db instead of MSSql2k and am having problems
with the DateTime in the db.

In mysqladmtools 1.0.19 I'm recommended to use 0000-00-00 00:00:00 as the
default value, but you can't save these settings. If you read the manual they
say the default value is thbe one above but that you can't use it, you have
to use a non zero value and with a non zero value you can't save the
settings. Pandoras box?

So far my solution has been to programmatically insert non zero datetime
values in every record. And it works just fine.

In my apps I'm using projects with a startdate and an enddate, and you don´t
want to see a non zero datetime value as the enddate so in mssql2k you could
use a SqlDateTime.Null value and save with db.null. Is there a ecvivalence in
MySql?

TIA

Kenneth P
Nov 19 '05 #1
2 2268
why doesn't system.dbnull not work for you? what error are you getting?

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"Kenneth P" <Ke******@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
Hi,

I'm trying to use MySql 4.1 db instead of MSSql2k and am having problems
with the DateTime in the db.

In mysqladmtools 1.0.19 I'm recommended to use 0000-00-00 00:00:00 as the
default value, but you can't save these settings. If you read the manual
they
say the default value is thbe one above but that you can't use it, you
have
to use a non zero value and with a non zero value you can't save the
settings. Pandoras box?

So far my solution has been to programmatically insert non zero datetime
values in every record. And it works just fine.

In my apps I'm using projects with a startdate and an enddate, and you
don´t
want to see a non zero datetime value as the enddate so in mssql2k you
could
use a SqlDateTime.Null value and save with db.null. Is there a ecvivalence
in
MySql?

TIA

Kenneth P

Nov 19 '05 #2
Oh, it does work. Was working late with many tables. Flaw in brain. Forgive me.

"Alvin Bruney [ASP.NET MVP]" wrote:
why doesn't system.dbnull not work for you? what error are you getting?

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"Kenneth P" <Ke******@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
Hi,

I'm trying to use MySql 4.1 db instead of MSSql2k and am having problems
with the DateTime in the db.

In mysqladmtools 1.0.19 I'm recommended to use 0000-00-00 00:00:00 as the
default value, but you can't save these settings. If you read the manual
they
say the default value is thbe one above but that you can't use it, you
have
to use a non zero value and with a non zero value you can't save the
settings. Pandoras box?

So far my solution has been to programmatically insert non zero datetime
values in every record. And it works just fine.

In my apps I'm using projects with a startdate and an enddate, and you
don´t
want to see a non zero datetime value as the enddate so in mssql2k you
could
use a SqlDateTime.Null value and save with db.null. Is there a ecvivalence
in
MySql?

TIA

Kenneth P


Nov 19 '05 #3

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

Similar topics

1
24585
by: Neal | last post by:
I have a MySQL table with a datetime field that stamps the time the user submitted the form. It works and looks like this: $sql = "INSERT INTO table VALUES(....now())"; On another php page to...
1
3511
by: Kenneth P | last post by:
Hi, I'm trying to do some Custom Paging technique with the datagrid object and with the select command in Sql, thus forcing the server to only select those rows from the database that should be...
5
3498
by: PKin via DotNetMonster.com | last post by:
Hi, I am trying to retreive a record from a MySql table and I get this error telling : Unable to convert MySQL date/time value to System.DateTime I am user the following command:...
0
1233
by: rlaemmler | last post by:
Hi, I just migrated my web app to .NET 2.0. Part of the app creates some business objects from a MySQL query which is returned by a web service. Some of those objects contain DateTime...
0
1916
by: ZoombyWoof | last post by:
Hi. I have ran into a weird thing I just can't find any solution for. I have googled and searched but no luck. The problem is that when I select TIME values from MySQL from python, I get wrong...
6
38905
by: Brandon | last post by:
I'm using PHP with MySQL 4.x and was having trouble converting a datetime from MySQL into a formatted string until I ran across this solution that converts a YYYY-MM-DD HH:MM:SS string into a...
12
4393
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
4
2410
by: Michael Sharman | last post by:
Hi guys, I'm a little confused with dates. Ok, all I want to do is store a date in MySQL as a datetime object and be able to read and format it using PHP. My datatype in MySQL is DATETIME and...
3
2616
by: len | last post by:
Hi All I have started a little pet project to learn python and MySQL. The project involves figuring out all the combinations for a 5 number lottery and storing the data in a MySQL file. The...
0
1701
by: Edwin.Madari | last post by:
-----Original Message----- statement prepared first and executed many times with exectemany - db API http://www.python.org/dev/peps/pep-0249/ inline statemets can be exeucuted only. hope that...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
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
7208
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
7379
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...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
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
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
657
muto222
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.