DCSIMG
is of a type that is invalid for use as a key column in an index - Entity Framework - שלמה גולדברג (הרב דוטנט)

שלמה גולדברג (הרב דוטנט)

מרצה בסלע ויועץ בעולם ה - net.

is of a type that is invalid for use as a key column in an index - Entity Framework

 

במידה ואתם משתמשים בשיטת Empty Model ב - EF, והגדרתם עמודה מסוג string שתהיה Primary Key, סביר להניח שבזמן שתעשו Generate database from model תקבלו את הודעת השגיאה:
 
 
 
Column 'Id' in table 'Entity1Set' is of a type that is invalid for use as a key column in an index.
 
כדי לפתור זאת חפשו את הגדרת העמודה בסקריפט שנוצר הוא יהיה כנראה מסוג:
nvarchar(max)
במקום הערך max הגדירו ערך הגיוני אחר ונסו שוב להריץ את הסקריפט, כעת זה אמור לעבוד.
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 2 and 2 and type the answer here:


Enter the numbers above: