troubleshooting Question

DataGrid and unique column

Avatar of andrewjb
andrewjbFlag for United Kingdom of Great Britain and Northern Ireland asked on
C#
2 Comments1 Solution272 ViewsLast Modified:
Hi... Kind of new to the data controls in DotNet, so hopefully this isn't too hard..

I've a table with an integer column that needs to be unique.

I can bind it to a datagrid, and let the user add/delete/edit stuff.

At the moment, he'll exit the dialog, I'll send the data back to the d/b, and it'll throw an exception if there's a duplicate..

So, how do I check for this and display a nicer message? I can trap for an exception when I save the data back, but does it supply enough info. that I can tell which record failed?

(I'm using MyGeneration and it's DooDads architecture to actually play with tables.. Though that probably doesn't matter?)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros