Forward mapping problem

7 posts, 0 answers
  1. gavin potter
    gavin potter avatar
    4 posts
    Member since:
    Nov 2009

    Posted 12 Nov 2009 Link to this post

    I've just started using the product but can't get the forward mapping to work.  I'm using Visual Basic with Mysql as a backend.  It generates a table for the class but doesn't include the properties of the class.  i.e. the system just produces a table with two fields, class1_id and voa_version. I've followed the instructions in OpenAccess ORM made easy around pages 30 onwards.  I'm sure I must be doing something very stupid.  I've also tried reverse mapping which works fine.

    Can anyone help?  Thanks
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 12 Nov 2009 Link to this post

    Hi gavin potter,

    Please make sure that the UpdateDatabase property of the project is set to True. If it is, verify that each persistent class has the Create / Update table option enabled in the Forward mapping wizard. You can see this option on the screenshot below:


    Let us know if this does not help.

    Regards,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. gavin potter
    gavin potter avatar
    4 posts
    Member since:
    Nov 2009

    Posted 12 Nov 2009 Link to this post

    Alexander

    Thanks for the quick response.

    I'm afraid both of those were set correctly.  I'm not sure what the problem could be - It seems very simple in the manual.  The only other oddity of my setup that I can think of is that I'm running this under Windows 7 64 bit but I can't really see why that should cause a problem.

    Thanks

    Gavin
  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 13 Nov 2009 Link to this post

    Hi gavin potter,

    The strange thing here is that a table is created but it does not contain all necessary columns. Could you please send us the class that you are trying to map, so we can test it here locally? In the meantime you can try to delete the database and build the project again.

    All the best,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. gavin potter
    gavin potter avatar
    4 posts
    Member since:
    Nov 2009

    Posted 13 Nov 2009 Link to this post

    Dear Alexander

    The class I am trying to map is:

    public class class1
     Public Property name() As String
            Get

            End Get
            Set(ByVal value As String)

            End Set
        End Property

    end class

    I have tried the c# examples from your website and these work fine.  I'm probably doing something stupid, but  is this a VB issue perhaps?

    I've tried deleting the database several times. 

    Thanks for your help.

    Gavin
  7. gavin potter
    gavin potter avatar
    4 posts
    Member since:
    Nov 2009

    Posted 13 Nov 2009 Link to this post

    Alexander

    Thanks to your last prompt I've found the issue.  It is that I wasn't defining the fields in the class.  If I make a suggestion, you might like to amend the example on page 31 of your OpenAccess ORM made easy manual to include the fields for the class - as a direct copy produces the error that I described.

    Thanks for your help.  I shall look forwards to using the product in earnest.

    Gavin
  8. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 16 Nov 2009 Link to this post

    Hi gavin potter,

    We verified this and it seems to be a bug in case of using auto properties in VB. Although there are some limitations when auto properties are used (you cannot access the field settings in the Forward mapping wizard), the table should be created normally with the default settings. This works with C# and we have scheduled it for fixing with VB. In the meantime, please use explicitly declared private fields and public properties.
    Thank you for reporting this, your Telerik points have been updated.

    Kind regards,
    Alexander
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
DevCraft banner