Re: Was Gamma, is just for speak
Posted by: Reggie Burnett
Date: December 09, 2004 09:14PM

Umberto Ballestrazzi wrote:
> While performances tests are running...
> I think that GetValue of DataReader (IDataRecord
> implementation) is used only by Framework
> (DataTable). I can't find a statement (on MSDN)
> that says that the returned type should be CLR/CTS
> compliant but if GetValue does not return a CTS
> many things stop works.
> You are right when you say that we should not
> loose dbms specific types or features (ie date
> ranges) but I think MS implementation (specifics
> calls to DataReader ie GetMySqlValue or
> GetMySqlDateTime) is not so bad...

I'm not sure you are right about things "not working" when you don't return a CTS type. I have now implemented IComparable on MySqlDateTime and am able to successfully pump a datatable full of MySqlDateTime, sort them using a dataview, and then print them out.

Now, if you are feeding a column in a typed datatable that is typed to be DateTime, then yes you would have a problem.

It's true that the docs are very vague on how non-CTS types should be handled when dealing with datasets, datatables, and data adapters.

One more item to think about. I think the connector *HAS* to work with tables that contain zero datetime values. While I will never understand why people use zero datetimes in MySQL, the fact is they do. The server will create zero datetime values if you feed it an illegal value. Since the connector has to support them, then what would happen if you attempted to update some records using a commandbuilder/dataadapter pair and the connector returned DateTime.MinValue for those values? The zero value in the database would get overwritten with 1/1/1 even though the user didn't change it. This is certainly not what we want. Some users actually use zero datetime to mean things and their apps wil break if the value is changed.

The short of this is if you have a datatable that might have zero datetime values in it, reader.GetValue() *MUST* return a MySqlDateTime. If not, the data adapter will not be able to update it successfully.


Options: ReplyQuote

Written By
December 06, 2004 11:37AM
December 07, 2004 09:55AM
December 09, 2004 02:50PM
December 09, 2004 03:19PM
December 09, 2004 03:50PM
December 09, 2004 04:11PM
Re: Was Gamma, is just for speak
December 09, 2004 09:14PM
December 09, 2004 04:56PM
December 09, 2004 06:08PM
December 09, 2004 09:07PM
December 10, 2004 02:07PM
December 10, 2004 02:25PM
December 10, 2004 02:48PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.