Hi

i am using vb to make a hospital system which works with a access database

i am having an issue with the updatign function to the database

this time round instead of hard codding the connection i used the connection/data source wizard

in microsoft visual studio 2008 and there fore most of the code has been auto generated for me

which includes the insert, delete and update funtions from what i can find and what i have read

vb is ment to also auto generate this which it is not.

the funny thing is that i can close the program down and reload it (as long as i haven't opened the database)

and my changes are still there but if i go and open the database and it hasn't changed.

also i can change the database through the use of the Dataset connections in the datasource tab

but not int he program the code ive found and believe that is meant to update the database is

this is running off a couple of buttons i also have a update query but have know way of accessing it

Me.Validate()

        Me.TblPatientDetailsBindingSource.EndEdit()

        Me.TableAdapterManager.UpdateAll(Me.PatientInfoDataSet)

thanking you in advanced.

for one, using the connection wizards are always harder than actually coding it yourself. It creates more problems than the worth of it, you will learn this in time.

One thing I found when I used to use the connection wizards were that when I'd use the SQL query builder, they would conflict and crash. The updating however, I used to copy & paste the wizard script into "input to database" form closing sub so it would reload the whole data grid.

With the whole changing in one place and not in the other, I have found this is because you are testing the program in debug mode of VS08 while using the wizard. Once you publish & build your program you will find that it will not happen.

Summary:

Its well worth the effort to hard code something rather than try to take the "easy" route because not only will it give you more power over whatever your programming, using wizards will always make it harder for you in the end.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.