Home > Net >  Winform and database is a little small problem, please help me look at it's too difficult
Winform and database is a little small problem, please help me look at it's too difficult

Time:09-22

99 children, I can't find the problem
P1 is the validation function of error
P2 is directly add the data in table form error
Complains is the content of the SQL statement, from the beginning to create table + constraints after I added three data respectively on two tables, then add the statement without any error,
Then in the back, and I have a problem to add statements (SQL) write in winform validation in the database, then an error appears as shown above, then I cut and paste a new add statements, himself to add content, or an error,
Finally, I try to directly in the table will add data or error

CodePudding user response:

Advice to search and understand what is a database of foreign key constraints,

CodePudding user response:

Record when the foreign key in the preservation need to verify the corresponding primary key value exists, such as "product category" hypothesis is a foreign key, it refers to a table called "categories", then the classification of each product value must first be found in the classification of a value, product record to save,

CodePudding user response:

Lack of id number, you don't see is null?

CodePudding user response:

Tip is very understand, it is recommended that the generated SQL statements, and then executed in the database, you can find the problem,

CodePudding user response:

Have to do is to find in the data

CodePudding user response:

Too good tahaole blogger so cow force

CodePudding user response:

Using the generated statements, running in the query analyzer in order to find the problem

CodePudding user response:

Good job

CodePudding user response:

Oh thank you upstairs, the problem has been solved, is write wrong relationship, careless thank you!

CodePudding user response:

11111111

CodePudding user response:

CodePudding user response:

CodePudding user response:

Good!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

You this is pure database operations

CodePudding user response:

A good tutorial, learn a lot
  •  Tags:  
  • C#
  • Related