hi venkat, if you want validate your textbox, simply use: namespace: using System.ComponentModel.DataAnnotations; and above the property add following: [StringLength(50),Required] publicstring Name { get; set; } why you use linq to sql for validation?
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
you can put validation using linq to sql query something like below:
if (query.Count() > 0) throw new Exception("Id already exists in the database");
if you want validate your textbox, simply use:
namespace:
using System.ComponentModel.DataAnnotations;
and above the property add following:
[StringLength(50),Required]
public string Name { get; set; }
why you use linq to sql for validation?