3
I’m creating the tables with the Entity Framework
, and I’m using the Data Annotation
to determine the amount of characters, I wanted to know which larger size was supported for typing text and whether the correct type would be string
even?
In case wanted one that fit as many as possible. By default use with 255.
[DisplayName("Informações Diversas")]
[Required(ErrorMessage = "Preencha as informações diversas")]
[StringLength(255, MinimumLength = 3, ErrorMessage = "As informações diversas deve ter de 3 a 255 caracteres")]
public string InformacoesDiversas{ get; set; }
In the database which is the expected type?
text
orvarchar
, alias which bank is using ?– novic
Mysql, about the expected type I can’t tell you, from the searches I did, it would be varchar, but when creating the class does not appear. I saw this font http://answall.com/questions/78812/quais-os-typed-existentes-no-mysql-para-textos and this is https://msdn.microsoft.com/pt-br/library/ee382832(v=vs.110). aspx
– Fabio Souza
You can wear it in your class
string
is correct andvarchar(255)
in Mysql for a text limit, if you do not want text limit use the typetext
in Mysql.– novic
In mysql all right, I understood, but in the class, there is the type text, at least I tried to import (using ctrl + . ), but nothing appeared
– Fabio Souza
the type you represent in the class is
string
stay calm is correct the way you represented.– novic