Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting an error.
"Column 'ListPrice' does not belong to table ListPrice."

I have an xml file and i am reading it to a datatable. Xml has table name "ListPrice" and xml has a column also having name "ListPrice".
Thats why getting this error. Some help plz.

Xml is:

XML
- <SendListPriceToHub ">
- <XMLData>
- <ListPrice>
  <CompanyID>abcd</CompanyID>
  <SalesOrg>yy</SalesOrg>
  <ProductID>55</ProductID>
  <ValidFrom>2011-07-01T00:00:00+10:00</ValidFrom>
  <ValidTo>9999-12-31T00:00:00+10:00</ValidTo>
  <UOM>aa</UOM>
  <ListPrice>456.25</ListPrice>
  <RecordType>a</RecordType>
  <LineID>555</LineID>
  <UpdatedDate>2011-07-22T17:41:53+00:00</UpdatedDate>
  </ListPrice>
  </XMLData>
  </SendListPriceToHub>



Thanks in advance.
Posted
Updated 21-Aug-11 4:01am
v3

1 solution

I don't really get your problem but from the error message, there may be a naming conflict.

Suggestions

  1. You can try to do some renaming
  2. You carefully check the type of ListPrice you're trying to access (it is possible you're mistaking the ListPrice Node in the XML for ListPrice Column in Table.
  3. Set a Breakpoint to see what went wrong at that point.


Note: The above are suggestions as your question is not clear to me
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900