當我嘗試插入數據庫時出現此錯誤。我已經檢查過這個尺寸是否足夠長,以及屬性是否合適。 這是我的SQL佈局。當插入新記錄時,獲取「字符串或二進制數據將被截斷。語句已被終止」
schoolID int (Primary Key)
schoolNaam varchar(50)
stad varchar(30)
我插入代碼:
BLSchool blSchool = new BLSchool();
List<School> scholen = blSchool.GetAll();
School school = new School();
school.SchoolNaam = schoolnaam.ToString();
school.Stad = schoolstad.ToString();
int schoolID = blSchool.InsertSchool(school);
db.Schools.InsertOnSubmit(school);
db.SubmitChanges();
return school.SchoolID;
這看起來不像傳統的ASP(VBScript或JScript)。 – webaware