M
meerkatinfrance
I am trying to convert some VB that uses Linq into C#
Is there anyone out there who is kind enough (clever enough) to show
me how to convert the following Sub loadAddress into C# for me.
Sub DoIt()
Dim WWV5 As New WWV5DataContext
Dim Xorg As Object
If Roles.IsUserInRole("Admin") Then
Xorg = (From o In WWV5.ORGs Where o.OrgID = ID Select o).Single
Else
Xorg = (From o In WWV5.ORGScopies Where o.OrgID = ID Select o).Single
End If
loadAddress(Xorg)
End Sub
Protected Sub loadAddress(ByRef pOrg As Object)
txtName.Text = pOrg.OrgName
txtCharNum.Text = pOrg.CharNum
txtAdd1.Text = pOrg.Add1
End Sub
Is there anyone out there who is kind enough (clever enough) to show
me how to convert the following Sub loadAddress into C# for me.
Sub DoIt()
Dim WWV5 As New WWV5DataContext
Dim Xorg As Object
If Roles.IsUserInRole("Admin") Then
Xorg = (From o In WWV5.ORGs Where o.OrgID = ID Select o).Single
Else
Xorg = (From o In WWV5.ORGScopies Where o.OrgID = ID Select o).Single
End If
loadAddress(Xorg)
End Sub
Protected Sub loadAddress(ByRef pOrg As Object)
txtName.Text = pOrg.OrgName
txtCharNum.Text = pOrg.CharNum
txtAdd1.Text = pOrg.Add1
End Sub