P: Update to DB with VBE & SQLE; Q: Where is the problem or what is missing?

Pre:
- WinXP En SP2; latest patches
- VBE installed
- SQLE installed & running on same machine

Scenario:
1. Start VBE
2. Create new WinApp
3. Add new DB; complete Wizard; crated DB & DS is empty
4. Open DB; create a Table with three Columns ("idUser",int,Ident Spec = Yes,DBNull = No;"Firstname",nvarchar(50),DBNull = No;"Lastname",nvarchar(50),DBNull = No)
5. Open DS, drop created Table from DB Explorer to DS View; You should the a class alike view of the table in the DS
6. Open Form1 Design and drop detail view of DS Table to form; You should see three labels, three Textboxes and a navigation bar on top; also four elements (DS,TA,BS,BNav) in component bar
7. Start App
8. Press Add (+) Button in Nav Bar; id TB should be 0
9. Add a first- & lastname; fistname enter "a"; lastname enter "b"
10. Press Save (Disk) Button in Nav Bar
11. Close App.
12. Open Table Data View, you see the new created User wasn't saved to DB.

Debuging shows, that the SaveItem_Click is called, wenn the Save Button in Nav Bar is pressed. Quickview of the table also shows, Table has one row; and Select, Insert, Delete and Update in the private Adapter are set correctly! I added a Try Block in the Click Event routine, to see if I get an exception. I also checked the return of the Update. It is 1. So here my Q: What's the problem Or what am I missing

Thanks for any help or suggestions. If the Q was ansered somewhere else, post the link, cause I couldn't find the answer!

PS: And yes I watched the Video Lesson 9 about Databinding, but the guy enters data direct into to DB, and later in the video, he save the data, and its working. But I want to start with a complete empty DB.

PS: And keep your hate and flame comments for yourself. Everybody had to start someday at zero!!


Answer this question

P: Update to DB with VBE & SQLE; Q: Where is the problem or what is missing?

  • Ben Chambers

    Lisa from MS, wrote in an other thread, to change the Property "Copy to Output Folder" of the .xsd to "Copy always". That solved the problem. If you change to connection string to the copy of the DB file in the bin directory, you see the DB was indeed updated. So apperently the new DB you see in the DB Explorer has nothing to do with the final DB file which is used by the running program. It is only a blueprint for doing all the fancy stuff with databinding.

    Thanks Lisa for the information. Maybe VBE should pop up an information about that fact.

    ByE, bavboy

  • P: Update to DB with VBE & SQLE; Q: Where is the problem or what is missing?