TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
scott oliver
NA
82
16.5k
using variables from another class
Nov 9 2020 3:36 PM
Hello all, I am having some problems. I cannot recall how to use a variable from another method in the same class. I have a basic form at this point and I am trying to set up a progress bar. I have 3 classes the form.cs, otcFetch.cs, and progress.cs.
In otcFetch.cs I am using rest sharp to go out and download a csv file and it inserts it into a sqlLite database.Here it is taking the csv file and seperating it for insertion.
string
[] strSeparators =
new
string
[] {
"\r\n"
};
string
[] Lines = response.Content.Split(strSeparators, StringSplitOptions.None);
string
[] Fields;
//update console
Console.WriteLine(
"Updating Database!"
);
//set value from number of lines in csv
int
numLines = Lines.Length;
It is inside this
public
void
otcRestClient() { }
I want to use the numLines value in another method in the same class. This variable will update my progress bar based on the number of lines in the CSV file. It will not allow me to use it though and not sure why. Any advise would be appreciated.
public
class
Variables
{
public
static
int
taskSize = otcFetch.Variables.THE VARIABLE WILL NOT LIST HERE???;
public
static
int
totalSize
{
get
{
return
taskSize; }
set
{ taskSize = value; }
}
}
Reply
Answers (
2
)
Generate Access Token For Dynamics 365 Single Tenant Server To Server
Create bucket for AWS S3 through asp.net C#