mimpact
asked on
.setordinal() element not accessible
I am trying to convert XML files to flat, pipe-delim output.
The approach I've chosen is to import into a dataset, do field and fieldvalue validation and write out to the delimited text file.
Sometimes a node is missing in the xml data, but the flat file must have all fields so i am checking the layout before creating the output file and inserting missing columns in the dataset.
When I try to set the ordinal position, I am getting an error.
System.data.datacolumn.pri vate sub setordinal(ordinal as integer) is not accessible because it is 'private'.
I am using Visual studio 2008
The method the code is in is a private sub, but I shouldn't have thought that would affect it.
The structure of the code is:
(this is not real - just a layout to illustrate the problem)
Public class widget
....
....
Private sub process_Stuff()
...
...
Dim DS as new dataset
...
' populate DS from xml file
....
' check structure
CheckStructure(DS)
...
' do more stuff
end sub
Private sub CheckStructure(dsData as Dataset)
...
' check if any missing columns by comparing to a field list
....
' if so, add the column and set it's position in the table
' get list if fields in dsFieldlists
......
' add column
with dsdata
For Each dr As DataRow In dsFieldLists.Tables("Detai l").Rows
If .Tables(cDetail).Columns.C ontains(dr ("FieldNam e")) = False Then
CreateField(.Tables(cDetai l), dr("FieldName"), dr("FieldType"))
dsData.Tables(cDetail).Col umns(dr("F ieldName") ).setOrdin al(dr("Fie ldOrdinal" ))
' no intellisense error, no compile error but runtime error is as above
End If
Next
end with
.....
end sub
end Class
any ideas?
The approach I've chosen is to import into a dataset, do field and fieldvalue validation and write out to the delimited text file.
Sometimes a node is missing in the xml data, but the flat file must have all fields so i am checking the layout before creating the output file and inserting missing columns in the dataset.
When I try to set the ordinal position, I am getting an error.
System.data.datacolumn.pri
I am using Visual studio 2008
The method the code is in is a private sub, but I shouldn't have thought that would affect it.
The structure of the code is:
(this is not real - just a layout to illustrate the problem)
Public class widget
....
....
Private sub process_Stuff()
...
...
Dim DS as new dataset
...
' populate DS from xml file
....
' check structure
CheckStructure(DS)
...
' do more stuff
end sub
Private sub CheckStructure(dsData as Dataset)
...
' check if any missing columns by comparing to a field list
....
' if so, add the column and set it's position in the table
' get list if fields in dsFieldlists
......
' add column
with dsdata
For Each dr As DataRow In dsFieldLists.Tables("Detai
If .Tables(cDetail).Columns.C
CreateField(.Tables(cDetai
dsData.Tables(cDetail).Col
' no intellisense error, no compile error but runtime error is as above
End If
Next
end with
.....
end sub
end Class
any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah. Open the solution in VS2005 and it will ask you to upgrade it and will upgrade it for you if you agree.
ASKER
what's involved in changing the project to target v2+?