in

TinyInt & Bit fields in SS using MySQL

Last post 02-25-2008 9:13 PM by buxjr. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 02-21-2008 3:53 PM

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    TinyInt & Bit fields in SS using MySQL

    When I use an entity to load a record, any field in the table defined as "TinyInt" datatype is returned as "Specified Cast is not valid".

    What is up with that?  The really interesting thing is, if you build a page using the Scaffold control, IT will see that TinyInt field as a Boolean candidate and add a Check Box to the Edit page AND properly save both a 0 and 1 state.  What gives?

    I'm sure I am just missing something here.  Can anyone tell what I am doing wrong?

    **************************************************************** 

    Dim n as new news(123)

    Me.chkEnabled.Checked = news.is_enabled

    ****************************************************************

    In debug, you can see that news.is_enabled is holding a value of {"Specified Cast is not valid."}  But the table in MySQL clearly has a 1 in it.

    Any and all help is appreciated.  I really don't want to set all of these TinyInt fields to Int fields.  Plus, if I did, the scaffold would present a textbox for numeric input.  Not good...

    Thanks in advance.

    Regards,

    BUXjr
  • 02-21-2008 5:55 PM In reply to

    Re: TinyInt & Bit fields in SS using MySQL

    I would recommend grabbing the latest version from SVN (325 as of this writing). I actually just made some changes to address MySQL problems, some of them specifically with the TINYINT data type.

    Found a bug? Help us fix it by submitting a Work Item!
  • 02-22-2008 12:16 AM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    Hey EK,

    Thanks for the tip.  I've done so and you are correct.  It appears that the TinyInt issue has been fixed.  Works perfectly now.

    However, Build 325 presents a new problem.  Now the scaffold doesn't write dates back to a MySQL datetime field properly.  There is an exception in "Update.cs", "Incorrect datetime value: '06/08/05 12:00 AM' for column 'news_date' at row 1".  It clearly isn't formatting dates the MySQL way.  However, in the last Release Build, it handled this with aplomb.  Was something changed in the way the scaffold writes dates back?

    Any help is, as always, greatly appreciated.

    TIA

    Regards,

    BUXjr
  • 02-22-2008 2:12 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    Awe, C'mon Eric...

    Don't leave us hangin'.  Is there any hope on this one?

    LMK - TIA

    Regards,

    BUXjr
  • 02-22-2008 3:44 PM In reply to

    Re: TinyInt & Bit fields in SS using MySQL

    Sorry, got caught up in some other stuff here... Scaffold is actually completely rewritten for 2.1, so I'm not surprised that a new data conversion issue might have come up. It should be a pretty straightforward fix.

    I'll get it fixed as soon as I can... 

    Found a bug? Help us fix it by submitting a Work Item!
  • 02-23-2008 11:23 AM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    Hey EK,

    Yeah, I see some new 'stuff' in there.  The ScaffoldType='auto', for instance, is wicked cool and a real time-saver.  I can seriously dig it.

    Thanks for looking in to it.  Let us know when we can pull an SVN v326!

    Thanks in advance.

    Regards,

    BUXjr
    Filed under:
  • 02-24-2008 4:29 PM In reply to

    Re: TinyInt & Bit fields in SS using MySQL

    I'm still getting the problem even with the latest rev. Does your Bit/tinyint field allow nulls?

    Mine does, and I'm getting Specified cast is not valid.TableSchema.cs    Line: 1737

  • 02-24-2008 5:05 PM In reply to

    Re: TinyInt & Bit fields in SS using MySQL

     I'm going to be check-in some changes that fix a number problems with this MySql provider tomorrow... I'll make sure that this covered as well...

    Found a bug? Help us fix it by submitting a Work Item!
  • 02-24-2008 8:21 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    EK -

    Oh, how this is music to my ears.  You rock!  Thanks for helping us out.  Can't wait.

    Let us know...

    Thanks!!!

    Regards,

    BUXjr
  • 02-25-2008 10:29 AM In reply to

    Re: TinyInt & Bit fields in SS using MySQL

    I've just checked in Revision 326... This should (I hope) address the problem with DateTime (and probably other data types) values and MySql. Still looking into the null issues...

    Found a bug? Help us fix it by submitting a Work Item!
  • 02-25-2008 10:39 AM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    You are da man!  I will pull it down and test as soon as I can, and let you know.

    Thanks, mate!

    Regards,

    BUXjr
  • 02-25-2008 9:13 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 56

    Re: TinyInt & Bit fields in SS using MySQL

    EK,

    As expected, it works like a charm!  Thanks again for looking into this and making all the necessary reparations.

    Nicely done.  v329 resolves all issues discussed in this thread.

    Regards,

    BUXjr
Page 1 of 1 (12 items)