kfirba
Well-known member
- Joined
- Dec 29, 2012
- Messages
- 77
- Programming Experience
- 1-3
Hello!
I tried to do a simple Select query, but for some reason, when im trying to populate a table with the query result, I get this error:
The error line:
The full code:
I can't understand how it's even related to the constraint! It's a SELECT query, im not attempting to Update/Delete/Insert any information, just pull out filtered information!
Here's the query:
Thanks in advance!
I tried to do a simple Select query, but for some reason, when im trying to populate a table with the query result, I get this error:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
The error line:
Using BorrowID As DataTable = BooksTableAdapter1.GetData_BorrowID_By_Given_BookID(bookID)
The full code:
Dim bookID As String bookID = lstBooks.SelectedValue Using BorrowID As DataTable = BooksTableAdapter1.GetData_BorrowID_By_Given_BookID(bookID) BorrowsTableAdapter1.Update_Borrow_End_To_False(BorrowID.Rows(0).Item(0).ToString) End Using BooksTableAdapter1.UpdateBookStatus(bookID, False)
I can't understand how it's even related to the constraint! It's a SELECT query, im not attempting to Update/Delete/Insert any information, just pull out filtered information!
Here's the query:
VB.NET:
SELECT Borrows.BorrowID
FROM (Books INNER JOIN
Borrows ON Books.BookID = Borrows.BookID)
WHERE (Books.BookID = @ BookID) AND (Books.BookBorrowed = True)
Thanks in advance!
Last edited: