System.Data.DataSet Error

soleman

New member
Joined
Oct 5, 2005
Messages
2
Programming Experience
10+
Hey Guys!
I’m new here, so I hope you guys can help.

I have 4 datasets:
DsCustCredratingSO1
DsCustCredratingSONew1
DsCustCredratingSOApp1
DsCustCredratingSOHold1

Which I’m passing through a datagrid (dgtsSalesOrders)


This code works:
'Load all sales orders data
odbdaCustomersCreditRatingsSO._

Fill(DsCustCredratingSO1)
odbdaSalesOrderAll.Fill(DsCustCredratingSO1)


dgtsSalesOrders.MappingName = _
DsCustCredratingSO1.tblSalesOrders. _
TableName dgSalesOrders.TableStyles.Add(dgtsSalesOrders)

However when I substitute DsTemp1 for DsCustCredratingSO1,

Private DsTemp1 As DataSet

DsTemp1 = DsCustCredratingSO1

'Load all sales orders data
odbdaCustomersCreditRatingsSO.Fill(DsTemp1)
odbdaSalesOrderAll.Fill(DsTemp1)


dgtsSalesOrders.MappingName = _
DsTemp1.tblSalesOrders. _
TableName dgSalesOrders.TableStyles.Add(dgtsSalesOrders)


I receive an Error:
‘tblSalesOrders’ is not a member of ‘System.Data.DataSet’

I just want to navigate all 4 datasets through my code with 1 generic variable name, DsTemp1.

Can anyone help me with this?
 
I think I've seen this before elsewhere, but I don't know whether it was solved there or not. Your DataSets appear to be strongly-typed. If you use an untyped DataSet variable to reference them then you cannot use members specific to those DataSets, which tblSalesOrders is. You would have to access the tables through the Tables collection of an untyped DataSet.
 
Back
Top