how to validat the data if the data allready exist in the table record in c#?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mani141990
    New Member
    • Sep 2014
    • 1

    how to validat the data if the data allready exist in the table record in c#?

    how to validat the data if the data allready exist in the table record in c#?
    for example i wanted to add the studend roll no. if roll no. is 134 and if we are adding rollno. 134 student then we get the warning like roll no. 134 is allready exist
  • pod
    Contributor
    • Sep 2007
    • 298

    #2
    You "addData" function should return a stringMessage

    Before adding any new records,
    your data layer script should perform a search for existing data.

    Code:
    search for existing data 
    If a match is found then 
       no data will be inserted
       return a message saying "unable to add, data already exist"
    else
       insert the data
       return a message insertion succesful
    end
    Hope this helps

    P:oD

    Comment

    Working...