[.net] Toolbox item exceptions

Started by
-1 comments, last by Chris27 15 years, 4 months ago
This isn't related to games, but I hope someone can help. I'm making a forms application with C# and I use a lot of the visual tools because it speeds things up and I have less code to worry about. I would like to know if there is anyway to catch exceptions that occur from visual tools. Normally if your right the code yourself you just make a try catch block, but with the visual tools you can't see the code and can't put a try catch block around it. Here is my problem. I have a typed dataset and a instance of that dataset created by the tools in the toolbox. I then use a bindingsource from the toolbox and attach it to the dataset. The primary key needs to be unique. When you put in the same data in one row as there is in another row and navigate to another row it throws an exception that the value must be unique. The problem is I don't know how to catch the exception for this. There is no code to put a try catch and it crashes the program. If the only recourse it to create the dataset and binding source in code that sucks IMO. Thanks

This topic is closed to new replies.

Advertisement