Click here to Skip to main content
14,924,138 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my question is i have two columns
1st is employeeid
2nd is employeename


employee id is primary key...

but i also want that employeename also unique..so how can i do on click of submit button.if employee name is match wid other colum..then message is display tht already exists..


i want thaat solution in LINQ
Posted

1 solution

Hi,


Database:
You should create a unique constraint for column employeename, this way, you will ensure that employeename is unique in your table.

Code:
You can verify if the name exists in the table before make the insert statement.

Regards
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900