In asp.net (c#),storing value to database(linqtosql),sqlexception -


In asp.net (c #), I use linqtosql, in the table, I set the property of a field Isunique True. When the same value is re-inserted, then this error shows (exception) "Duplicate key line can not be inserted into the object 'dbo.student' with unique index ', exception to me Need to capture and display error message .. Sxlexness? Thanks in advance ...

The easiest form of this is:

   
Get the error {// code to try to insert} hold (SqlException ex) {// Get the error}

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -