473,406 Members | 2,847 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,406 software developers and data experts.

DataRow Remove problem

My code is so simple that I want to remove the row. However, After process
the below code, I browse the table, nothing is deleted.

dtRemark.DefaultView.RowFilter = "cocode ='ABC'"
Dim myDataRow As DataRow
myDataRow = dtRemark.DefaultView.Item(0).Row
dtRemark.Rows.Remove(myDataRow)

dtRemark.acceptchanges()
dsRemark.update()
daRemark.Update(dsRemark, "CompanyRemark")
dsRemark.AcceptChanges()

Nov 21 '05 #1
1 2454
is daRemark your data adapter? Have you built the Update, Insert, and Delete
strings for the data adapter?

Personally I never liked using the DataAdapter to do anything more than
fetch my data. I alwas update data with my own SQL code that I execute on
the connection object... but that's just me! :-)
--
--Zorpie
"Agnes" wrote:
My code is so simple that I want to remove the row. However, After process
the below code, I browse the table, nothing is deleted.

dtRemark.DefaultView.RowFilter = "cocode ='ABC'"
Dim myDataRow As DataRow
myDataRow = dtRemark.DefaultView.Item(0).Row
dtRemark.Rows.Remove(myDataRow)

dtRemark.acceptchanges()
dsRemark.update()
daRemark.Update(dsRemark, "CompanyRemark")
dsRemark.AcceptChanges()

Nov 21 '05 #2

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

Similar topics

3
by: Allan Bredahl | last post by:
Hi All I have a bit of a problem with using a datarow to store data that is show in a form. On form load I set the Value/Text properties of my form elements to the specific Column values of...
6
by: Wanda | last post by:
Hello, I tried to update a row in a table by using the datarow and data adapter. Unfortunately, it doesn't update. I try finding that datarow and set it to "dr", I can see dr could be just an...
3
by: Agnes | last post by:
Dim drTemp As DataRow For Each drTemp In dtInvCharges.Select("invno ='" & Me.txtInvNo.Text.Trim & "' ") dtInvCharges.Rows.Remove(drTemp) Next I got a "Delete button" to delete all rows in that...
3
by: michael_geller | last post by:
While experimenting with binding datasets to an MS DataGridView, I get a warning that tells me that my DataRows are "either undeclared or was never assigned". Assuming that I am reading the...
5
by: samoore33 | last post by:
I use the code below to search through a DataSet: Dim t As DataTable t = result.Tables("State") Dim strExpr As String strExpr = "id = '" & theState.ToString() & "'" Dim foundRows() As DataRow...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
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...
2
by: =?Utf-8?B?TWFyYw==?= | last post by:
In Visual Studio 2005, I am developing a Windows Mobile application, using Mobile SQL 2005. I need Data from a Database to be shown in a DataGrid, this works. But now I want to be able to get the...
2
by: Paulo | last post by:
DataRow dr = (DataRow)ds.Tables.Rows.ItemArray; Error 1 Cannot convert type 'object' to 'System.Data.DataRow' C:\Documents and Settings\Fabio\Meus documentos\Visual Studio...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.