I'm reading on this on MSDN and it doesn't really describe much. It says that it is used to specify the data type to associate with a data column or a parameter. Makes sense. Does this mean I should use it on all of my properties? I assume not. So why is there a DataType.Text, seems pretty useless when you have a property as a string.
I've found a use for it to use multi-line text as a datatype to create a textarea on the client side instead of just a single line text input element. But how does this relate to a data column or paramater?
I also assumed that it would also validate it since I used DataType.Url but it goes through whether or not a Url is entered or not. Same with DataType.Email. Is there something I'm doing wrong or do I need to use a RegEx instead?
See my MSDN article DataType Enumeration These are NOT validation attributes. From the MSDN article:
The DataTypeAttribute attribute lets you mark fields by using a type that is more specific than the database intrinsic types. For example, a string data field that contains e-mail addresses can be attributed with the EmailAddress type. This information can be accessed by the field templates and modify how the data field is processed. (that is, create a link)