HighTechTalks DotNet Forums  

VB.net MSAccess Update

VB.net Data microsoft.public.dotnet.languages.vb.data


Discuss VB.net MSAccess Update in the VB.net Data forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dan Paulovich
 
Posts: n/a

Default VB.net MSAccess Update - 09-24-2009 , 02:26 AM






Hello All

I'm using VB.net Express 2008. I am working on an application
that has a form with a data bound DataGridView. I want to be
able to select a cell and delete rows starting with the row selected
until a particular text is encountered. The logic below works fine
deleting the corect rows in the dataset but does not alter the
MSAccess database. I use similar logic to add data/rows and that
works fine, updating the database. Any help will be greatly appreciated.
I have the dtatbase "Copy to Output Directory" property set to "DO not copy"
The following is the code I'm using:
DG3Strng = FoodDatabaseDataSet.Meals.Rows(DelRowIndex).Item(0 ).ToString

If InStr(DG3Strng, "Breakfast") = 1 Or InStr(DG3Strng, "Lunch") = 1 Or InStr(DG3Strng, "Dinner") Or
InStr(DG3Strng, "Snack") = 1 Then

Do Until DG3Strng = "Percent Daily Value"

DG3Strng = FoodDatabaseDataSet.Meals.Rows(DelRowIndex).Item(0 ).ToString

FoodDatabaseDataSet.Meals.Rows.RemoveAt(DelRowInde x)

Loop

FoodDatabaseDataSet.Meals.Rows.RemoveAt(DelRowInde x)

Me.MealsBindingSource.EndEdit()

Try

Me.MealsTableAdapter.Update(Me.FoodDatabaseDataSet .Meals)

FoodDatabaseDataSet.Meals.AcceptChanges()

Catch ex As Exception

End Try

End If

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.