asa asa - 4 months ago 36
SQL Question

How update string field with length of 300 with entity

I want to update one field of one table, the problem is when it goes to be bigger than 128 character SQL isn't let me to update.

The identifier that starts with … is too long. Maximum length is 128

The strange thing is I was adding 300 character with entity , but I can't update it.

Here is my code:

var objcompany = _entities.Companies.FirstOrDefault(o => o.Username == user.Trim());



Based On your Code.Update your model before saving to Database

_entities.Entry(objcompany).State = EntityState.Modified;//Add this Line