473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Delete Row from DataTable

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

Oct 5 '06 #1
1 1308
Samoore,

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

I hope this helps,

Cor
"samoore33" <sa*******@gmail.comschreef in bericht
news:11**********************@c28g2000cwb.googlegr oups.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

Oct 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Jones | last post by:
I'm trying to delete a row from a DataGrid using a ButtonColumn with CommandName="Delete" by deleting the row in the underlying DataTable datasource, but it doesn't seem to be working at the...
2
by: Mark Jones | last post by:
I'm trying to delete data from a DataGrid using a ButtonColumn with a CommandName="Delete" but it's not working a the min. I'm using session data which fills a DataTable which then fills the...
5
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
0
by: Giovanni pepe | last post by:
This is my error : <<impossible to approach the information on the line eliminated through the line>> This is my code for updateBatch : Private mSqlConn as sqlConnection Public Function...
16
by: Sam | last post by:
Hi, As I loop through a dataview's records, I delete datarow based on a condition. However I don't want to commit those deletions until the loop ends. With a datatable, i would just set...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
5
by: rn5a | last post by:
The .NET 2.0 documentation states the following: When using a DataSet or DataTable in conjunction with a DataAdapter & a relational data source, use the Delete method of the DataRow to remove...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
2
by: JoaquimC | last post by:
Hello, I need to delete a group of rows from a DataTable based on a condition. Something like: string CRefeicao = "01", CFamiliaPrato = "02"; foreach (DataRow LinhaDetalhe in Detalhe.Rows)...
4
by: AW | last post by:
XP & VB 2005 using the help files - followed instructions to use the table adapter to delete a row from the database. I step thru the table find the rows to delete and issue a .Delete() and after...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.