15,911,785 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.