locked
Problem with setup foregin key in lightswitch programaticly RRS feed

  • Question

  • hi,

    I am having troubles with assigning foreign key into table pragmatically. I am importing XML file into table. 

    I was able to manage read XML and insert into table as well. As I am beginner with LS I expect it is very simple to fix it. 

    what I am having problem is assigning foregin key, the error I gets is 'InvalidOperationExecution was unhandled by user code'.

    I really appreciate you one of you, experiences coders help me with this

    below is code:

    Private Shared Sub AddData(dataList As List(Of String()), iDataWorkspace As DataWorkspace)

    For Each row As String() In dataList
    Dim iFaktura As FAKTURY = iDataWorkspace.MobData.FAKTURies.AddNew()

    iFaktura.FAK_NO = row(0)

    'I am getting error at following line
    iFaktura.EVIDENCIASIM = iDataWorkspace.MobData.EVIDENCIASIMs_Single(row(1))

    iFaktura.FAK_PRICE = Replace(row(2), ",", ".")
    iFaktura.FAK_OBDOBIE = Date.Parse(row(3))
    Next

    End Sub

    Thursday, April 11, 2013 9:56 PM

All replies

  • Did you get this figured out?  This is one of those lightswitch entity features that takes a few times to get used to.  If you didn't get it figured out I'm happy to point you to a few posts, maybe a training video that goes over this.


    Would someone please turn on the LIGHT?

    Tuesday, April 16, 2013 4:28 PM