0

i m using Linq to SQl for my project, i tried all CRUD operations (Create, Delete, Edit, details) its working, but how to perform validation, means adding Required , Range, and other common Validation using System. Data. Annotation class,

I don know how to do this, please help me in detail, as i am beginner, how should i validate all user input fields.

1

1 Answer 1

0

Create a partial class for the entity and add a MetadataTypeAttribute on it. Then create the meta data class with object properties and then put annotations on them.

http://diegworld.blogspot.com/2011/05/using-dataannotations-to-validate.html

Sign up to request clarification or add additional context in comments.

2 Comments

i tried, that but i'm confused what to create as partial claass , how it should be named ? please can u explain in detail, i have a dataclasses1.dbml (linq to Sql file ), now how u add this metadata attirbute, please really waiting for help :(
thank you. i got the solution by referening stackoverflow.com/questions/1535662/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.