save data

slimjen1

Member
Joined
Nov 14, 2005
Messages
8
Programming Experience
1-3
Hello, I have an input form that saves the data as long as the form is open. But, once the form is closed, the data disappears. I created a table and connected the datasource to the form. The following is the code i'm using. Please help and tell me what's wrong.

VB.NET:
[SIZE=2][COLOR=#0000ff]
Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] btnSave_Click([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] btnSave.Click
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Validate()
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TblClientsBindingSource.EndEdit()
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TblClientsTableAdapter.Update([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ScottProjectDataSet1.tblClients)
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
 
So let me get this straight, you have a form with some controls that allow you to modify some rows in a dataset/datatable. You have instantiated a dataadapter and set it's select/update etc commands. And when you click Btnsave it doesn't update the datasource, without producing an error?!?? if i'm write so far then there, as far as i can see, does'nt appear to be a lot wrong with the code youv'e shown.
I'd probably need to see the project so i can get a better idea of whats going wrong.:)
 
Back
Top