MySql and SByte

All your dOOdad needs ...

MySql and SByte

Postby mosenturm on Thu Mar 24, 2005 9:33 am

Hi,

this is the first time that I use MyGeneration to generate dOOdads BE. Thanks for the great software!
But ... we've got a problem ...

I get the error:

Code: Select all
error BC30456: \"GetSByte\" isn't a Member of \"MyGeneration.dOOdads.MySql4Entity\".
Return MyBase.GetSByte(ColumnNames.Active)


If I change the mapping to TINYINT to Byte there is no error while compile time. (MySQL 2 Language Mapping / MySql Connector.NET VB.NET)
Now I get an error on runtime:


Code: Select all
System Invalid Cast Exception: Invalid Type Casting from Type 'SByte' to Type 'Byte'


EDIT:
The Debugger shows the error in BusinessEntity.vb at:
Code: Select all
' Byte (real)
        Protected Function GetByte(ByVal columnName As String) As Byte
            Return CType(_dataRow(columnName), Byte)
        End Function


What's going wrong?
Thanks for any help!

Andreas
mosenturm
Lurker
 
Posts: 3
Joined: Wed Mar 23, 2005 1:27 pm
Location: Germany

Postby mike.griffin on Thu Mar 24, 2005 1:28 pm

Andreas, I must have forgotten to add that to the VB.NET BusinessEntity class, open your BusinessEntity.vb class in your MyGeneration.dOOdads project and clone GetByte and SetByte and create GetSByte and SetSByte changing the types to SByte where appropriate, I will make the same changes here, a minor maintenance release will come out in April with this fix. Please let me know the outcome.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

MySql and SByte VB.NET Patch

Postby mosenturm on Thu Mar 24, 2005 2:06 pm

Hi Mike,

I've copied the GetByte/SetByte and the GetByteAsString/SetByteAsString functions in BusinessEntity.vb to GetSByte/SetSByte and GetSByteAsString/SetSByteAsString and changed the type Byte in SByte. Now everything is working fine.

You can download the file at http://www.vocote.de/test/BusinessEntity.vb
Thanks!
Andreas
mosenturm
Lurker
 
Posts: 3
Joined: Wed Mar 23, 2005 1:27 pm
Location: Germany

Postby mark100net on Fri Apr 08, 2005 6:02 pm

Also using MySQL2 (but with C#) I had a similar problem where compilation failed due to the absence of the following methods:

GetsbyteAsString
SetsbyteasString
GetushortAsString
SetushortAsString

I followed the approach in Mike's previous post, making the changes in BusinessEntity.cs and it seems to work so far.

Let me know if you want me to send you the revised file.

Mark
mark100net
Lurker
 
Posts: 6
Joined: Fri Apr 01, 2005 4:21 pm

Postby mike.griffin on Wed Apr 13, 2005 2:46 am

mosenturm, I got your changes in. Now, mark100net can you post the code to those four C# methods I'll get them in, I'm preparing the next release so any help is appreciated, I could recreate them but I'm going to wait for you to post them and move on to my next issues, thanx guys !
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Re: MySql and SByte

Postby marclar on Mon Dec 08, 2008 8:22 pm

Hi, everyone -- I still had problems with Andreas' BusinessEntity.vb file, so I put one here:

http://marclar.posterous.com/mygeneration-fix
marclar
Lurker
 
Posts: 1
Joined: Mon Dec 08, 2008 8:07 pm


Return to dOOdads - MyGeneration's .NET Architecture

Who is online

Users browsing this forum: No registered users and 0 guests

cron