?
Solved

Best way to pass data from project to project?

Posted on 2014-01-16
4
Medium Priority
?
191 Views
Last Modified: 2014-02-17
I have a solution in which I have built an Error Handling Project that consists of 1 class. I need to have every other Project including my main assembly be able to talk with this project...so, I declare a new instance of the Error Handling class in each Form and Project,

    Private EH As New ErrorHandling.ErrorHandler

Open in new window



however, in doing some testing, and I will use my DataLayer (a separate Project) as the example, I've noticed that whenever an exception occurs, I populate the EH.strRetVal (strRetVal is a public variable declared within my ErrorHandler) with the exception message but I don't pass it back because in the DataLayer, I'm passing back either a DataSet or DataTable. So in this case the exception goes unnoticed.

What I'm thinking is that if I change the signature of the function to return Object instead of DataSet/DataTable, how do I check the return value to see if it's an error message or a DataSet/DataTable?

Thanks!
0
Comment
Question by:BlakeMcKenna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39786110
You never use Object when you know what you need. Its prone to bugs, lowers performance, and requires casting for most uses.

Look at how the framework is built. It is always a good indication of what you should do. When an event or a method needs to return many values, they created a class with the necessary properties.

Simply create a small class that has a property for the DataSet/DataTable (which one?) and another for the message. Have the function return an object of this class, so both informations will be available.
0
 

Author Comment

by:BlakeMcKenna
ID: 39786133
What about just creating a DataSet/DataTable property and an Integer property in the ErrorHandling class?
0
 

Author Comment

by:BlakeMcKenna
ID: 39786184
I went ahead and added 3 properties to my ErrorHandling Class. But now, I'm not sure what my signature should look like in the called routine.
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 39866211
Thanks James...that gave me some ideas!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question