Friday, November 9, 2012

MySqlDataReader reading tinyint (byte) as bool

Regrettably, work has forced me to work with MySql as I have been working in a LAMP enviorment instead of my beloved .net. However, if I make a utility I go right back to C#.

While making a little utillity that interface with MySql I used the MySQL Connector Net 6.1.6 library and the included MySqlDataReader. It has a very strange behavior where it thinks tinyints are bool. It took me about a day to track this down.

reader.ReadByte to the rescue.

Thursday, February 23, 2012

Views Make The Entity Framework More Tolerable

As of late, I have been on the war path against The Entity Framwork, some of my peers and I have been bitten in the butt too many times. However, being less database focused, I have overlooked something very important; creating views in the database and then creating entities off of them can make your life much easier.

However, I still maintain that the best use of EF is when your DB consists of simple one-to-many relationships.