1
Answer

How to solve exception in C#.net

Shomen Deb

Shomen Deb

16y
3.6k
1
I have combobox referring the "Book_id" field of Book table from bookbindingsource dataset. when I select option, I'm shown this message "Column 'Book_id' is constrained to be unique. Value '899866238' is already present." and in the troubleshooting exceptions portion, there is written "Relax or turn off constraints in your DataSets. Make sure you are not trying to assign a value to a primary key field where the primary key already exists in the data table". This is not clear to me. Can anybody help me? Regards, Shomen
Answers (1)
0
jrosa

jrosa

NA 7 0 20y
I found my own solution... I found that I could not have a DateTimePicker control bound to the dataset. When the DateTimePicker control was bound to the dataaset, the data would not display in any of the controls on the form. When I "un-bound" the DateTimePicker control, then the data woudl display properly. I bound an edit box to the date column and then updated the DateTimePicker control when the value of the edit box changed.