Not able to pass values back from method call

Posted on 2012-08-25
Last Modified: 2012-08-26
I have a Visual Studio 2010 Solution with 3 projects in it.  I do some backend processing in Project B and Project C, calling a method in each project from Project A.

I have several TextBoxes in Project A that I fill from the processing in Project C.  I pass those textboxes as parameters to the method in Project C, where I fill them in with data.

My problem is that the data does not get returned to the calling Project A.

Here is the call to the method in Project C from Project A:
GetBookInfo gbi = new GetBookInfo();
gbi.getBookInfo(mtbISBN.Text, tbTitle.Text, tbAuthor.Text, tbPub.Text);

Open in new window

Here is the code in Project C:
public bool getBookInfo(string isbn, string tbTitle, string tbAuthor, tbPub)  {

    parseReturnData(isbn, tbTitle, tbAuthor, tbPub);
return true;

private bool parseReturnData(string isbn, string title, string author, string pub)  {
   isbn = "12345";
   title = "blah, blah, blah";
   author = "me";
   pub = "hostPress";
  return true;


Open in new window

Question by:rmmarsh
    LVL 43

    Accepted Solution

    >>I pass those textboxes as parameters

    Please post that code - your code given only passes the contents into the function.

    Author Comment

    Andy:  I think that's the problem...  how do I pass the TextBoxes to the Project C so I can fill in the value and have it appear in Project A's main form?  Do I pass "(TextBox) tbName" to the method in Project C?

    Author Closing Comment

    Thank you... that did it...
    LVL 43

    Expert Comment

    Basically yes - pass the textbox itself (by it's name).
    You need to also look at and understand reference types and value types of objects.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now