I have a table "Users", in my domain model I've a class "User" mapped to this table. In my "Users" table I've 2 fields : FirstName and LastName. In my class I would create a new property called DisplayName wich would be the concatenation of the properties FirstName and LastName.
How can I do that ?
Here's what I have tried :
. I create a partial class with "DisplayName" property (readonly)
. I create a new user
. I had the new user to my openaccesscontext object, and this error appear : Internal error: struct slot access (provideField_invalidSlotNumber, slot=-1)
What's wrong ?
Here's my code :
Here's my partial class :
Please help.
11 Answers, 1 is accepted
We tried the same setup as you have provided but we could not reproduce this false behavior. If you are willing to send us a small project that reproduces the behavior I will gladly convert the conversation to one that allows attachments.
We are looking forward to your reply.
Petar
the Telerik team
I was trying to isolate my problem in a small project without success until moment I declared a private variable in my partial class. In my exemple if you suppress "_displayname" private variable the problem disapear.
When you try to reproduce my problem do you declare this private variable in your partial class ?
The problem is that I need this private variable because in my final solution I don't need a readonly property in my partial class but a read/write property. How can I do this ?
Thanks for your help.
I stumbled on the same error "Internal error: struct slot access (provideField_invalidSlotNumber, slot=-1)".
I deleted entity from the model designer and drag and droped it again into it to solve the problem.
Hope it helps.
Rok
Please help...
Thanks
After debugging and researching your problem we have found out what the issue is. The runtime system picks up fields that you have defined in the partial and marks them as persistent. This is in fact a bug and we will be working on fixing this. However there is a small and easy fix you can do in order to get things working, at least for now.
What you need to do is mark the field you define in the partial with the Transient attribute (it is located in the Telerik.OpenAccess namespace). I have tested this out and it seems to be the solution to your problem.
Sorry for the inconvenience caused. Please do find your Telerik points updated for reporting this issue and do not hesitate to contact us back if you face further trouble.
Serge
the Telerik team
It's slightly annoying to not be able to use auto-properties (in VB) because of this.
For example (and for other's benefit):
I CANNOT use:
<
Transient
()> _
Public Property RateCheck As String = String.Empty
I must use:
<
Transient
()> _
Private _RateCheck As String
<
Transient
()> _
Public Property RateCheck() As String
Get
Return _RateCheck
End Get
Set(ByVal value As String)
_RateCheck = value
End Set
End Property
At least that is the only way I was able to get it to work...
Sure, we will update the thread once this is fixed.
Greetings,
Alexander
the Telerik team
The issue is fixed and the solution can be found in the internal build released yesterday. Note that you will have to be logged in, in order to download it.
Best wishes,Serge
the Telerik team
I have tested this with the new 2010 Q3 release.
Looks like it still isn't working. I am getting an error when my partial class is accessed:
"Invalid column name '_add_on_check'. Invalid column name '_container_check'. Invalid column name '_g_l_code_check'. Invalid column name '_order_ref_check'. Invalid column name '_price_check'. Invalid column name '_quantity_check'. Invalid column name '_rate_check'. Invalid column name '_un_matched_check'. Invalid column name '_weight_check'. Statement(s) could not be prepared."
This is a result of thie partial class that seems to cause this error:
Partial
Public
Class
TMDiscrepancyHeader
<Transient()> _
Public
Property
RateCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
WeightCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
ContainerCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
OrderRefCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
GLCodeCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
PriceCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
QuantityCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
UnMatchedCheck
As
String
=
String
.Empty
<Transient()> _
Public
Property
AddOnCheck
As
String
=
String
.Empty
I thought things were fixed with regard to this??
If I use the following syntax...things work:
<Transient()> _
Private
_RateCheck
As
String
<Transient()> _
Public
Property
RateCheck()
As
String
Get
Return
_RateCheck
End
Get
Set
(
ByVal
value
As
String
)
_RateCheck = value
End
Set
End
Property
I am sorry for the misunderstanding, after debugging we have found out that you are using attributes mapping in for your model. It turns out that we have another bug here, however we have it planned for improvement and the issue will be fixed. I will notify you (again) in this thread when the issue is resolved.
However for the time being you can either switch to XML mapping or continue using the workaround you previously found.
I hope this is helpful.
Serge
the Telerik team