none
Insert foreign key fields using datasource navigator RRS feed

  • Question

  • Hi all,

    Using Dataset programming if i have some foreign key fields and i keep that field value as static variable (say int static x) on main form of my project then when i want to insert data using datasource navigator how can insert x automatically immediately when i press new button on navigator because i don't want to appear that foreign key field as a field on it is own form .

    Hope i explained my problem correctly.

    Thanks


    Esmat

    Sunday, January 27, 2019 7:55 AM

All replies

  • Hello,

    It's a little unclear about the insert from the BindingNavigator, can you be more specific on this 

    how can insert x automatically immediately when i press new button on navigator because i don't want to appear that foreign key field as a field on it is own form .


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, January 27, 2019 10:45 AM
    Moderator
  • Hi Karen,

    When you drag your table to your form (as detailed) it should create all your table field with it BindingNavigator to add, delete or save , so when I click on add new button i want to add foreign key value automatically from somewhere as i mentioned that.

    Esmat


    • Edited by Esmat_Halfa Tuesday, January 29, 2019 6:27 AM
    Tuesday, January 29, 2019 6:19 AM
  • Hi Esmat_Halfa,

    For your question, please try the examples in the link below about BindingNavigator.

    https://www.codeproject.com/Articles/15596/BindingSource-and-BindingNavigator-in-C-2-0

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 1, 2019 6:24 AM
    Moderator