Home All Groups Group Topic Archive Search About

Delete Row from DataTable

Author
5 Oct 2006 7:23 PM
samoore33
Through searching on the web, I have learned how to delete a row from a
DataTable. My problem is that I need to delete a certain row. I am
writing an XML file into a DataSet, the file is below.

<States>
  <state>
    <id>NY </id>
    <Flat>False</Flat>
    <Taxes>
      <Tax>
        <Min>0</Min>
        <Max>124.99</Max>
        <Value>4.25</Value>
      </Tax>
      <Tax>
        <Min>125</Min>
        <Max>999999</Max>
        <Value>6.25</Value>
      </Tax>
    </Taxes>
  </state>
</States>

The two items in the child element Tax have the same identifier. That
is where my problem arises. The only way I have found to delete one of
the Tax elements is by using the identifier. But both of those elements
has the same idetifier.

I would like to know if there is anyway to use the Value node to delete
the record? With all of my searches, I can only find ways to delete
using the identifier. Any help would be appreciated.

Thanks for any help

Scott Moore

Author
6 Oct 2006 3:49 AM
Cor Ligthert [MVP]
Samoore,

You can use the dataview.find to get the index.
http://windowssdk.msdn.microsoft.com/en-us/library/18kktzs4.aspx

I hope this helps,

Cor


Show quoteHide quote
"samoore33" <samoor***@gmail.com> schreef in bericht
news:1160076216.855432.222990@c28g2000cwb.googlegroups.com...
> Through searching on the web, I have learned how to delete a row from a
> DataTable. My problem is that I need to delete a certain row. I am
> writing an XML file into a DataSet, the file is below.
>
> <States>
>  <state>
>    <id>NY </id>
>    <Flat>False</Flat>
>    <Taxes>
>      <Tax>
>        <Min>0</Min>
>        <Max>124.99</Max>
>        <Value>4.25</Value>
>      </Tax>
>      <Tax>
>        <Min>125</Min>
>        <Max>999999</Max>
>        <Value>6.25</Value>
>      </Tax>
>    </Taxes>
>  </state>
> </States>
>
> The two items in the child element Tax have the same identifier. That
> is where my problem arises. The only way I have found to delete one of
> the Tax elements is by using the identifier. But both of those elements
> has the same idetifier.
>
> I would like to know if there is anyway to use the Value node to delete
> the record? With all of my searches, I can only find ways to delete
> using the identifier. Any help would be appreciated.
>
> Thanks for any help
>
> Scott Moore
>