Oracle 5.0 Reference Manual page 1937

Table of Contents

Advertisement

<ExceptionInterceptors>
<add name="myE"
type="ExceptionStackTraceTest.MyExceptionInterceptor,ExceptionStackTraceTest" />
</ExceptionInterceptors>
</MySQL>
Once you have done that, your connection strings can look like these:
MySqlConnection c1 = new MySqlConnection(@"server=localhost;pooling=false;
commandinterceptors=myC");
MySqlConnection c2 = new MySqlConnection(@"server=localhost;pooling=false;
exceptioninterceptors=myE");
20.2.5.12. Handling Date and Time Information in Connector/Net
MySQL and the .NET languages handle date and time information differently, with MySQL allowing
dates that cannot be represented by a .NET data type, such as
differences can cause problems if not properly handled.
The following sections demonstrate how to properly handle date and time information when using
Connector/Net.
20.2.5.12.1. Fractional Seconds
Connector/Net 6.5 and higher support the fractional seconds feature introduced in MySQL 5.6.4.
Fractional seconds could always be specified in a date literal or passed back and forth as parameters
and return values, but the fractional part was always stripped off when stored in a table column. In
MySQL 5.6.4 and higher, the fractional part is now preserved in data stored and retrieved through SQL.
For fractional second handling in MySQL 5.6.4 and higher, see
the behavior of fractional seconds prior to MySQL 5.6.4, see
To use the more precise date and time types, specify a value from 1 to 6 when creating the table
column, for example
the decimal point. Specifying a precision of 0 leaves the fractional part out entirely. In your C# or
Visual Basic code, refer to the
MySqlDateTime
by the
GetDateTime
For related code examples, see the following blog post:
entry/milliseconds_value_support_on_datetime
20.2.5.12.2. Problems when Using Invalid Dates
The differences in date handling can cause problems for developers who use invalid dates. Invalid
MySQL dates cannot be loaded into native .NET
Because of this issue, .NET
MySqlDataAdapter
exception to occur.
20.2.5.12.3. Restricting Invalid Dates
The best solution to the date problem is to restrict users from entering invalid dates. This can be done
on either the client or the server side.
Restricting invalid dates on the client side is as simple as always using the .NET
to handle dates. The
database are also valid. The disadvantage of this is that it is not useful in a mixed environment
where .NET and non .NET code are used to manipulate the database, as each application must
perform its own date validation.
Connector/Net Programming
or DATETIME(6), representing the number of digits of precision after
TIME(3)
Millisecond
object returned by the
GetMySqlDateTime
function also contains the fractional value, but only the first 3 digits.
objects cannot be populated by the
DataSet
class as invalid dates will cause a
class will only allow valid dates, ensuring that the values in your
DateTime
'0000-00-00
Fractional Seconds in Time
Fractional Seconds in Time
member to retrieve the fractional second value from the
function. The
https://blogs.oracle.com/MySqlOnWindows/
objects, including
DateTime
System.ArgumentOutOfRangeException
1917
00:00:00'. These
Values. For
Values.
object returned
DateTime
dates.
NULL
method of the
Fill
class
DateTime

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents