473,385 Members | 1,342 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,385 software developers and data experts.

winapp: how to detect removeitem using bindingsource?

nev
251 100+
i would like to know how to detect if user perform a removeitem from bindingsource so that i can ask him if he's sure. i'll update the dataset at once if he's sure. how?
Jan 3 '08 #1
5 1343
debasisdas
8,127 Expert 4TB
you need to capture the event that is initiating the action.
Jan 3 '08 #2
nev
251 100+
what i really want to do is, when i delete a record, i want my program to update the dataset at once.

in my current program, i still placed a save button which can be clicked by the user if he wants to save changes like deleting a record. i also have a refresh button. when a user deletes a record, i use the built-in delete button of the bindingnavigator to handle the deletion. it removes the record successfully then the user must click the save button to update the underlying database.

i want to place an update code in the built-in delete function of the bindingnavigator. so that the save button will not be required anymore?

please help/guide me to the light.
Jan 3 '08 #3
nev
251 100+
soory for that unclear explanation. here i think i can explain clearer...

i placed this code in form load:
bindingnavigator.deleteitem = btndelete

that is how i delete a record but in reality in only does removeitem in my bindingsource. if i click the refresh button, the record that is supposed to be deleted will still be there.

i want to modify that delete function so that after it do removeitem, i'll call tableadapter.update to proceed with really updating the database.
Jan 3 '08 #4
nev
251 100+
help! i really need help here. please.
Jan 3 '08 #5
nev
251 100+
i did a custom delete procedure instead. and so far it works.

bs.removecurrent
update database
Jan 3 '08 #6

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

Similar topics

1
by: John | last post by:
What is the difference between using a Word/Excel Project via Office Tools in Visual Studio versus using a standard WinApp Project and setting a reference to Word or Excel? Specifically are...
1
by: TN | last post by:
I just don't get the BindingSource class when it is bound to a class. Consider this code snip: ..... Private bSource As New BindingSource() Private dgv As New DataGridView() Public Sub New()...
0
by: Geoff | last post by:
Hi folks Calling BindingSource.ResetCurrentItem() is changing the BindingSource.Position in a way I don't understand. If I'm understanding the docs correctly, ResetCurrentItem() should simply...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
2
by: Steve Richter | last post by:
what is the best way to use DataGridView to view data from large database tables? Where the sql select statement might return millions of rows? string connectionString =...
4
nev
by: nev | last post by:
i have a bound textbox. i am in record 2 and textbox displays 'hello'. now i added code to automatically save a new word entered in textbox. for example, while in record 2 which textbox displays...
3
nev
by: nev | last post by:
if i have "2007-01-01 00:00:00", how can i get the "2007-01-01" only? and by the way, will this work? dim str as string str = datetimepicker.text bindingsource.filter = " ='" & str & "'" ...
0
by: Tony Johansson | last post by:
Hello! Here I display all the existing rows in the products table in the database using the TableAdapter fill method to put these rows into the DataTable object. private void...
2
by: jehugaleahsa | last post by:
Hello: I'm working on improving some of our Windows Forms. I have created two user controls that I want to bind to the same BindingSource. I have an overview control that is used just to...
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: 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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.