vb.net - Database parent-child connection problmen -


i have following code

 imports system.data    public class reservationlist  private sub guestlisttoolstripmenuitem_click(byval sender system.object, byval e system.eventargs) handles guestlisttoolstripmenuitem.click     'show registration table      guestlistform.show()     me.hide() end sub  private sub highrisetoolstripmenuitem_click(byval sender system.object, byval e system.eventargs) handles highrisetoolstripmenuitem.click     ' shows box     highriseaboutbox.show() end sub  private sub exittoolstripmenuitem_click(byval sender system.object, byval e system.eventargs) handles exittoolstripmenuitem.click     ' terminates program     highriseaboutbox.show()     me.close() end sub  private sub newreservationtoolstripmenuitem_click(byval sender system.object, byval e system.eventargs) handles newreservationtoolstripmenuitem.click     ' restarts program     newreservationform.show()     me.close() end sub  private sub exitbutton_click(byval sender system.object, byval e system.eventargs) handles exitbutton.click     ' terminates program      highriseaboutbox.show()     me.close() end sub  private sub reservationlist_load(byval sender system.object, byval e system.eventargs) handles mybase.load      'todo: line of code loads data 'cottagesdataset.guests' table. can move, or remove it, needed.     me.gueststableadapter.fill(me.cottagesdataset.guests)     'todo: line of code loads data 'cottagesdataset.reservations' table. can move, or remove it, needed.     me.reservationstableadapter.fill(me.cottagesdataset.reservations)  end sub  private sub last_namelabel_click(byval sender system.object, byval e system.eventargs)  end sub   private sub last_namecombobox_selectedindexchanged(byval sender system.object, byval e system.eventargs) handles last_namecombobox.selectedindexchanged  end sub end class 

and when run (debug) program this

enter image description here

i trying setup parent-child relation show shown below:

enter image description here

and .xsd relation have

enter image description here

so that's have can show you. idea why getting error? seems check on database have setup same way. followed book tutorial , didnt miss anything. i'm close dump whole idea make work.

thanks

the 'failed enable constraints' error occurs when have form of database schema error.

to fix them:

  1. make sure primary keys disallow null values, , haven't stored nulls in there yet.

  2. make sure 'relation' columns (last name, guest) non-null, , haven't stored nulls in there yet.

  3. if changed length of strings last name, guest can store, after adding data, might hit issue encountered here: http://social.msdn.microsoft.com/forums/en-us/vsexpressvb/thread/27aec612-5ca4-41ba-80d6-0204893fdcd1/


Comments