C
C#2y ago
EliasGPS

✅ Can't insert data in my ASP.NET database

i don't know what i'm doing wrong
52 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
i think yes
SqlException: Cannot insert explicit value for identity column in table 'Country' when IDENTITY_INSERT is set to OFF.
SqlException: Cannot insert explicit value for identity column in table 'Country' when IDENTITY_INSERT is set to OFF.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
i saw somewhere that it is not safe to turn that on
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
LOL
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
hahaha
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
the thing is
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
that file is called DBInitialize.cs and we need to use that file but ok i will try
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
i'm a student
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
and the teacher gave us the file to fill in our database
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
i made the table
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
idk i did not know
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
uhu
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
but i never use a create table so i created a model with all attributes i have a context file
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
uhu i'm sorry but its my first time with this so yeah
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
yes
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
this is the data model
EliasGPS
EliasGPSOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
owwww hahahahhahahahahah
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
but i mean when i look at the test data
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
i really specify the CountryID the same with Team
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
all the others are auto-generated but ok thx i will try to find a solution
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2y ago
tebeco#0205
Quoted by
From tebeco#0205
React with ❌ to remove this embed.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
ok thx for your help! maybe chatgpt will do the work! hahah
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
EliasGPS
EliasGPSOP2y ago
i think this will fix it jep everything works
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EliasGPS
EliasGPSOP2y ago
jep everything solved
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server