CraigLazar
asked on
loop thru fields in a dataset
Hi,
I need to build a string value based on the fields in my dataset.
So if there are say 3 or 9 fields in the datset row, i need to loop thru the fields and then simply add them to a string
thanks
I need to build a string value based on the fields in my dataset.
So if there are say 3 or 9 fields in the datset row, i need to loop thru the fields and then simply add them to a string
thanks
ASKER
Hi Tim
i get this error
code
Dim MyString As String = String.Join(",", tmpds.Tables(bs.DataMember ).Rows(0). ItemArray)
"Unable to cast object of type 'System.Object[]' to type 'System.String[]'."
i get this error
code
Dim MyString As String = String.Join(",", tmpds.Tables(bs.DataMember
"Unable to cast object of type 'System.Object[]' to type 'System.String[]'."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi i thought as much, and thats what i have done
thanks man
have a good weekend
cheers
thanks man
have a good weekend
cheers
CraigLazar,
You too, let's hope the sun shines!
TimCottee
You too, let's hope the sun shines!
TimCottee
ASKER
hi Tim, sorry hope u do not mind me asking u anoterh question on the same line here - how would i get the same field information of a bindingsource object? cause i take my dataset and i give it to a bindingsource object for the form
thanks
thanks
CraigLazar,
Good question, I would suggest that you try explicitly casting it. Something along the lines of:
For Each itmData As Object In CType(MyObject.BindingSour ce,System. Data.DataS et).Tables (0).Rows(0 ).ItemArra y
TimCottee
Good question, I would suggest that you try explicitly casting it. Something along the lines of:
For Each itmData As Object In CType(MyObject.BindingSour
TimCottee
ASKER
ok i hacked atround and got this working :)
tmpDataString = getRowData(drv.Row.ItemArr ay())
wehre getRowData is my little array looping function
cheers
tmpDataString = getRowData(drv.Row.ItemArr
wehre getRowData is my little array looping function
cheers
Dim MyString As String = String.Join(",", MyDataSet.Tables(0).Rows(0
For example.
Regards,
TimCottee