Click here to Skip to main content
15,888,177 members
Home / Discussions / C#
   

C#

 
QuestionC# Excel: Creating a named range? Pin
Goalie3517-Dec-09 10:03
Goalie3517-Dec-09 10:03 
AnswerRe: C# Excel: Creating a named range? Pin
hamed-vojdani18-Dec-09 7:07
hamed-vojdani18-Dec-09 7:07 
Questionc# serial port Pin
aniarun17-Dec-09 9:11
aniarun17-Dec-09 9:11 
AnswerRe: c# serial port Pin
Garth J Lancaster17-Dec-09 10:03
professionalGarth J Lancaster17-Dec-09 10:03 
GeneralRe: c# serial port Pin
aniarun17-Dec-09 11:21
aniarun17-Dec-09 11:21 
GeneralRe: c# serial port Pin
Garth J Lancaster17-Dec-09 11:36
professionalGarth J Lancaster17-Dec-09 11:36 
GeneralRe: c# serial port Pin
aniarun17-Dec-09 12:10
aniarun17-Dec-09 12:10 
GeneralRe: c# serial port Pin
Roger Wright17-Dec-09 18:57
professionalRoger Wright17-Dec-09 18:57 
GeneralRe: c# serial port Pin
aniarun20-Dec-09 12:28
aniarun20-Dec-09 12:28 
GeneralRe: c# serial port Pin
Roger Wright20-Dec-09 13:46
professionalRoger Wright20-Dec-09 13:46 
QuestionWeb Service Object References Pin
RacerNerd17-Dec-09 9:09
RacerNerd17-Dec-09 9:09 
AnswerRe: Web Service Object References Pin
Abhinav S17-Dec-09 17:07
Abhinav S17-Dec-09 17:07 
QuestionHigh Load Asynchronous TCP Server & Client Discussion Pin
Harvey Saayman17-Dec-09 8:41
Harvey Saayman17-Dec-09 8:41 
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 

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.