Click here to Skip to main content
15,899,026 members

Comments by Anzeis (Top 2 by date)

Anzeis 29-Oct-14 2:10am View    
I already checked, it is.

I also tried something more now, I deleted the table SALES and created it again with no FK this time, and tried to debug it again, it keeps showing me the same message:

The INSERT statement conflicted with the FOREIGN KEY constraint"FK__sales__id_book_1920BFC". THe conflict ocurred in database "....Bookstore.mdf", table"dbo.INVENTARY", colum 'id_book'.
The statement has been terminated.

I checked on Visual Studio, on the DataSet, to see if the constraint was still there, but it wasn't, there are no constraints left and it keeps showing me that error.
Anzeis 29-Oct-14 1:29am View    
I'm trying to insert the value '1' into id_book of the table SALES,
the table INVENTORY has only 1 record, and the id_book for it '1'.

I have tried it using SQL Server to run this query and it worked perfectly:
INSERT INTO SALES (id_book,member,date_sale,time_sale)
Values (1,0,'01/01/2014','09:09:09 AM')

I didn't get any error when I ran that query,
but I keep getting that error when I try it on Visual Studio.