You haven't provided value for
Id_Teacher and
Adress. You need to provide a value or you can pass
NULL or just ignore the column from the
INSERT statement.
1. Ignoring Columns
Insert Into Teacher1(Name, Familyname, Phone, Mobile, Email, Fk_Sex, Fk_Major, Fk_Education)
Values("Kamran", "Mortazavi", 8899100, 09126254019, "K.m.r@yahoo.com", 2, 3,2)
But for this query to execute successfully, you need to have IDENTITY on for the column
Id_Teacher
2. Passing NULL
Insert Into Teacher1(Id_Teacher, Name, Familyname, Phone, Mobile, Email, Adress, Fk_Sex, Fk_Major, Fk_Education)
Values( NULL,"Kamran", "Mortazavi", 8899100, 09126254019, "K.m.r@yahoo.com",NULL , 2, 3,2)
Important
I strongly recomend you to use parameterized query or stored procedure to avoid SQL Injection.
Read this tutorial:[
^]
Hope, it helps :)