Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple visual studio question - updating record 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I have just moved over from MSAccess vb Programming to Visual Studio and I am stuck before I have really started.
I have followed the help video files that came with visual studio and also read and reread the help files.
I created the database with a single table (as in the video)and 3 rows of data
I have created the Dataset and set up the form with the textboxes as shown in the vid.
I created a save button using the code supplied:
BindingSource1.EndEdit()
CustomerTableAdapter.Update(MyCompanyDataSet.Customer)
No matter how I try, as soon as I close the form and reopen, the customer name has not changed.

Even loading the source material from the video i.e. forms and vb code, still does not update the table in the database.
Have I missed something or am I doing something wrong?
All I want to do is to change a record and the change to be passed back to the original table. TIA


'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Hi aj, you need this forum forum796 for .net questions...

Also (this is strictly my views and forum members may disagree but...), I know Microsoft rave about them but I just dont like Datasets and would most def not use them for 3 rows of data!

Nick
 
Hi Nick

My apologies for using the wrong forum.
I take your point about '3 rows of data' but all I wanted was to prove the record update method, as I said in my initial post, I am a newbie to these forums although I am quite proficient in vb programming behind MSAccess.


'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Hi Aj, there could be many reasons why this isn't updating, have tou called the GetChanges() method on your DataTable before calling the update on the adapter? Best thing to do is post your full code in the .net forum and I'll be able to have a look at it there and hopefully help you understand what has gone wrong.

I spent many years programming in VB, VBA and Access VB but found it easier to start from scratch when learning .net!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top