none
data grid binding RRS feed

  • Question

  • Hello,

    This application uses Person and PersonContacts Table for processing. The PersonContacts table follows a pattern with Primary Field. If One Contact is Primary then it must appear in Text Boxes otherwise it should appear in DataGridView control.

    The Application is able to process everything properly regarding showing of existing items and updating of existing items. But for new data entry I am confused.

    I followed the concept of DataRow.SetParentRow but it is throwing exception of Foreign Key Conflicts.


    Please let me know about, what would be best method for new data entry.


    Friday, November 28, 2014 10:12 AM

Answers

  • Hello JDKEE,

    >>I followed the concept of DataRow.SetParentRow but it is throwing exception of Foreign Key Conflicts.

    What exception does it occur and show some related code?

    >> Please let me know about, what would be best method for new data entry.

    If you want to insert a new entry with ADO.NET, in my opinion, firstly, I would check if the entry exists, if not, then performing the insertion. If it has constraints as foreign key, specifying the foreign key explicitly if you know. You could check this article below, it also shows how to use the SetParentRow method:

    Inserting relational data using DataSet and DataAdapter

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 1, 2014 7:18 AM
    Moderator