This is a migrated thread and some comments may be shown as answers.

Forward mapping problem

6 Answers 103 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gavin potter
Top achievements
Rank 1
gavin potter asked on 12 Nov 2009, 10:51 AM
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

6 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 12 Nov 2009, 12:38 PM
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.
0
gavin potter
Top achievements
Rank 1
answered on 12 Nov 2009, 03:09 PM
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
0
Alexander
Telerik team
answered on 13 Nov 2009, 03:15 PM
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.
0
gavin potter
Top achievements
Rank 1
answered on 13 Nov 2009, 03:23 PM
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
0
gavin potter
Top achievements
Rank 1
answered on 13 Nov 2009, 05:11 PM
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
0
Alexander
Telerik team
answered on 16 Nov 2009, 11:03 AM
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.
Tags
Data Access Free Edition
Asked by
gavin potter
Top achievements
Rank 1
Answers by
Alexander
Telerik team
gavin potter
Top achievements
Rank 1
Share this question
or