Click here to Skip to main content
15,899,025 members
Home / Discussions / C#
   

C#

 
QuestionMicrosoft Reporting (subreports) Pin
kruegersck17-Dec-09 8:09
kruegersck17-Dec-09 8:09 
QuestionTrying to retrieve a variable from a program Pin
JTRizos17-Dec-09 6:38
JTRizos17-Dec-09 6:38 
I have a form (form1.cs) that sends a transaction record variable (TranRec) to a program (Transporter.cs) by calling it using Transporter.ConnectToDMV(TranRec);.

Transporter.cs does what it needs to do and returns to form1.cs for the user to enter and submit another transaction. Here's part of the Transporter.cs code.

Transporter.cs

public partial class Transporter
{
public static void ConnectToDMV(string TranRec)
{ rest of code processing TranRec ...

What I also need Transporter.cs to do is return a variable (logLU) back to form1.cs. For this I am using the following code;

Transporter.cs

Form1 aForm = new Form1();
aForm.SetValue(logLU);

form1.cs

public void SetValue(string luValue)
{
logLU = luValue;

// for testing purposes
MessageBox.Show("Here's the value of (form1)luValue: " + luValue);
MessageBox.Show("Here's the value of (form1)logLU: " + logLU);

}

I can see both variables in the messageboxes so I know logLU gets to form1.cs but then it returns to null when I need it in other parts of form1.cs. What am I missing??? Similar code works in other parts of my program but not here. BTW, I'm a newbie to C# and this is my first application.

Any advise will be very much apprecaited. Confused | :confused:
AnswerRe: Trying to retrieve a variable from a program Pin
ricmil4217-Dec-09 6:49
ricmil4217-Dec-09 6:49 
GeneralRe: Trying to retrieve a variable from a program Pin
JTRizos17-Dec-09 7:11
JTRizos17-Dec-09 7:11 
GeneralRe: Trying to retrieve a variable from a program Pin
ricmil4217-Dec-09 7:27
ricmil4217-Dec-09 7:27 
GeneralRe: Trying to retrieve a variable from a program Pin
JTRizos17-Dec-09 8:34
JTRizos17-Dec-09 8:34 
GeneralRe: Trying to retrieve a variable from a program Pin
ricmil4217-Dec-09 8:39
ricmil4217-Dec-09 8:39 
GeneralRe: Trying to retrieve a variable from a program Pin
JTRizos17-Dec-09 8:48
JTRizos17-Dec-09 8:48 
AnswerRe: Trying to retrieve a variable from a program Pin
Alan N17-Dec-09 9:12
Alan N17-Dec-09 9:12 
AnswerRe: Trying to retrieve a variable from a program Pin
JTRizos17-Dec-09 9:43
JTRizos17-Dec-09 9:43 
QuestionPropertyGrid usage Pin
rbuchana17-Dec-09 5:30
rbuchana17-Dec-09 5:30 
AnswerRe: PropertyGrid usage Pin
Dr.Walt Fair, PE17-Dec-09 5:50
professionalDr.Walt Fair, PE17-Dec-09 5:50 
GeneralRe: PropertyGrid usage Pin
rbuchana17-Dec-09 6:14
rbuchana17-Dec-09 6:14 
GeneralRe: PropertyGrid usage Pin
Dr.Walt Fair, PE17-Dec-09 7:09
professionalDr.Walt Fair, PE17-Dec-09 7:09 
GeneralRe: PropertyGrid usage Pin
rbuchana17-Dec-09 7:09
rbuchana17-Dec-09 7:09 
QuestionAutomate Web Browser control in Multiple Threads Pin
Sumit_Ghosh17-Dec-09 4:56
Sumit_Ghosh17-Dec-09 4:56 
AnswerRe: Automate Web Browser control in Multiple Threads Pin
Dave Kreskowiak17-Dec-09 10:59
mveDave Kreskowiak17-Dec-09 10:59 
Questionmagnify support Pin
pvn g17-Dec-09 4:08
pvn g17-Dec-09 4:08 
AnswerRe: magnify support Pin
Dr.Walt Fair, PE17-Dec-09 5:48
professionalDr.Walt Fair, PE17-Dec-09 5:48 
GeneralRe: magnify support Pin
pvn g17-Dec-09 18:35
pvn g17-Dec-09 18:35 
GeneralRe: magnify support Pin
pvn g17-Dec-09 18:35
pvn g17-Dec-09 18:35 
QuestionCasting objects to get at the contents? Pin
MattFunke17-Dec-09 3:33
MattFunke17-Dec-09 3:33 
AnswerRe: Casting objects to get at the contents? Pin
Migounette17-Dec-09 4:11
Migounette17-Dec-09 4:11 
GeneralRe: Casting objects to get at the contents? Pin
MattFunke17-Dec-09 4:22
MattFunke17-Dec-09 4:22 
AnswerRe: Casting objects to get at the contents? Pin
OriginalGriff17-Dec-09 4:15
mveOriginalGriff17-Dec-09 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.