473,654 Members | 3,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Defaul tView.RowFilter = "cocode ='ABC'"
Dim myDataRow As DataRow
myDataRow = dtRemark.Defaul tView.Item(0).R ow
dtRemark.Rows.R emove(myDataRow )

dtRemark.accept changes()
dsRemark.update ()
daRemark.Update (dsRemark, "CompanyRemark" )
dsRemark.Accept Changes()

Nov 21 '05 #1
1 2462
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.Defaul tView.RowFilter = "cocode ='ABC'"
Dim myDataRow As DataRow
myDataRow = dtRemark.Defaul tView.Item(0).R ow
dtRemark.Rows.R emove(myDataRow )

dtRemark.accept changes()
dsRemark.update ()
daRemark.Update (dsRemark, "CompanyRemark" )
dsRemark.Accept Changes()

Nov 21 '05 #2

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

Similar topics

3
6985
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 the DataRow which works just fine.
6
5998
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 instance of the row, but aren't linked to the table. Is that why it doesn't update? If not, what is missing? Please help!!! Dim da As New SqlDataAdapter("select * from Table1", cn)
3
11593
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 Table. and the process "SAVE", In the screen , i can see the datagrid got nothing, however, as i check back my table in SQL, The data still here ?? Please help bmInvInfo.EndCurrentEdit()
3
1808
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 documentation correctly, you are supposed to create a DataRow using the "DataTable.NewRow()" method. This is what I do in my app. As a matter of fact, the DataRow constructor appears to be protected so I can't directly create it if I want to. Is...
5
11673
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 foundRows = t.Select(strExpr) This of course returns foundRows. My problem is that I need to return
10
24169
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
3104
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 the row. The Delete method marks the row as Deleted in the DataSet or DataTable but does not remove it. Instead when the DataAdapter encounters a row marked as Deleted, it executes its DeleteCommand method to delete the row at the data source. The...
2
4827
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 Data of the selected DataRow, for instance, I want to display the value of the "Klant" column of the selected Row using: DataRow currentRow = table.Rows; MessageBox.Show(currentRow.ToString());
2
10259
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 2005\Projects\CodBarraPalm\CodBarraPalm\Default.aspx.cs 35 26 CodBarraPalm ? why this error trying to get the contents of a row on a DataSet?
0
8372
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.