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

Why does DELETE not delete rows from underlying database table?

*WeightCheck is a dataset connected to a mdf SQL server file
*Datagrid on form is bound to the dataset
*This code executes because datagrid on form updates with the deletions
*Exit application and restart, the old data is still there!!!!!


Expand|Select|Wrap|Line Numbers
  1. Dim oldRows As DataRow() = Me.EventLog.EventLogDataTable.Select(filter)
  2. Dim filter As String
  3. filter = String.Format("WeighedAt<#{0}#", Today - TimeSpan.FromDays(My.Settings.WeightCheckDaysToKeep))
  4.             oldRows = e.WeightCheck.FailedWeightCheck.Select(filter)
  5.  
  6.             For Each r As DataRow In oldRows
  7.                 Console.WriteLine(r.Item(0))
  8.                 r.Delete()
  9.             Next
  10.  
  11.             Me.WeightCheck.FailedWeightCheck.AcceptChanges()
Feb 5 '10 #1
1 1666
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.


Database How-to parts 1 and 2
Database tutorial Part 1
Database tutorial Part 2
Feb 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
by: Bob Ganger | last post by:
Hello, I am working on a project using SQL Server 2000 with a database containing about 10 related tables with a lot of columns containing text. The total current size of the database is about...
5
by: jeff | last post by:
i am using ms access as my database i can successfully delete a single record from a table using : targetRow.Delete() Try reportDataAdapter.Update(reportDataSet, "table1" )...
7
by: Richard Marsden | last post by:
(also posted to microsoft.public.access.odbcclientsvr but no reply so far: problem concerns ODBC->MS Access) I have some ODBC code that I'm testing against various underlying databases. The...
9
by: Dejan | last post by:
Hy, Sorry for my terreble english I have this simple code for deleting rows in mysql table... Everything works fine with it. So, what do i wanna do...: my sql table looks something like...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
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...
2
by: Kevin M | last post by:
I have created a form with 7 fields which is linked to one table. Is there anyway to delete all records in the table from the form? Thanks Kevin
2
by: =?Utf-8?B?QmV0bw==?= | last post by:
I am developing a ASP.NET application, with C# code-behind classes; with SQL Server 2000. All database access is made through stored procedures. I can insert, select and update in all tables...
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: 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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.