Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using strongly typed datasets in a remoting scenario.
Message
 
To
26/08/2002 15:59:49
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00693728
Message ID:
00693868
Views:
23
Hi Bonnie,

My C# middle tier is returning a dataset. From what I've read, when doing remoting, all datasets are returned as untyped. In order to get a strongly typed dataset, I have added the .vb file created from the XML Schema Designer to the solution. I then created an instance of the strongly typed dataset, and an instance of an untyped dataset. When I make the call to the middle tier, I'm passing the untyped dataset as the reference. Once the call is complete I'm using the merge method of the strongly typed dataset to import the data from the untyped dataset. It seems I can access the fields by name after that, however, when I try doing a row find using the primary key I keep getting nothing returned back to me. The row object is always nothing. I have checked the data and it is valid. Not sure what I'm doing wrong. I suspected the primary key wasn't there, but perhaps it is something else I'm doing wrong. I've attached the code in question.

Dim dsStrong As New CorporationDataSet()
Dim objCorporation As ICorporation
Dim type As Type = GetType(ICorporation)
Dim intErr As Int32
Dim intTest As Int32 = 1

objCorporation = CType(Activator.GetObject(type, "tcp://.../Corporation"), ICorporation)

intErr = objCorporation.GetCorporations(CreditUnionID, ActiveType.ALL, mdsCorporations)

dsStrong.Merge(mdsCorporations)
Dim tbl As CorporationDataSet.CorporationDataTable = dsStrong.Corporation
Dim row As CorporationDataSet.CorporationRow()
row = tbl.FindByCorporationID(intTest)
If row Is Nothing Then
Console.WriteLine("Row not found")
Else
Console.WriteLine("Found " & row.NameVC & " - " & row.CorporationID)
End If
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform