Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
GeneralRe: Seeking a better understanding of .NET multithreading and the System.Threading.Tasks.Parallel methods Pin
pr1mem0ver24-Apr-21 4:09
pr1mem0ver24-Apr-21 4:09 
GeneralRe: Seeking a better understanding of .NET multithreading and the System.Threading.Tasks.Parallel methods Pin
Richard Deeming25-Apr-21 21:16
mveRichard Deeming25-Apr-21 21:16 
GeneralRe: Seeking a better understanding of .NET multithreading and the System.Threading.Tasks.Parallel methods Pin
pr1mem0ver24-Oct-21 11:49
pr1mem0ver24-Oct-21 11:49 
AnswerRe: Seeking a better understanding of .NET multithreading and the System.Threading.Tasks.Parallel methods Pin
Gerry Schmitz23-Apr-21 7:07
mveGerry Schmitz23-Apr-21 7:07 
QuestionIPC Implementation for sending an integer from C++ exe to C# exe Pin
LokeshVarman22-Apr-21 22:32
LokeshVarman22-Apr-21 22:32 
QuestionRe: IPC Implementation for sending an integer from C++ exe to C# exe Pin
Richard MacCutchan22-Apr-21 23:05
mveRichard MacCutchan22-Apr-21 23:05 
AnswerRe: IPC Implementation for sending an integer from C++ exe to C# exe Pin
Victor Nijegorodov22-Apr-21 23:11
Victor Nijegorodov22-Apr-21 23:11 
GeneralRe: IPC Implementation for sending an integer from C++ exe to C# exe Pin
LokeshVarman23-Apr-21 0:06
LokeshVarman23-Apr-21 0:06 
QuestionHow to access incrementing ID number in SQL CE? Pin
Alex Dunlop22-Apr-21 5:49
Alex Dunlop22-Apr-21 5:49 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
OriginalGriff22-Apr-21 6:08
mveOriginalGriff22-Apr-21 6:08 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
Dave Kreskowiak22-Apr-21 6:23
mveDave Kreskowiak22-Apr-21 6:23 
AnswerRe: How to access incrementing ID number in SQL CE? Pin
SeanChupas22-Apr-21 6:43
SeanChupas22-Apr-21 6:43 
QuestionHow to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 4:49
Alex Dunlop21-Apr-21 4:49 
AnswerRe: How to preserve DataGridView row and text color when using column filters? Pin
Gerry Schmitz21-Apr-21 6:22
mveGerry Schmitz21-Apr-21 6:22 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 6:34
Alex Dunlop21-Apr-21 6:34 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Gerry Schmitz21-Apr-21 6:45
mveGerry Schmitz21-Apr-21 6:45 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Alex Dunlop21-Apr-21 16:53
Alex Dunlop21-Apr-21 16:53 
GeneralRe: How to preserve DataGridView row and text color when using column filters? Pin
Dave Kreskowiak21-Apr-21 17:27
mveDave Kreskowiak21-Apr-21 17:27 
Questionrecord list access Pin
Frank-Cziryek19-Apr-21 12:16
Frank-Cziryek19-Apr-21 12:16 
AnswerRe: record list access Pin
Dave Kreskowiak19-Apr-21 17:51
mveDave Kreskowiak19-Apr-21 17:51 
GeneralRe: record list access Pin
Frank-Cziryek19-Apr-21 19:43
Frank-Cziryek19-Apr-21 19:43 
GeneralRe: record list access Pin
Pete O'Hanlon20-Apr-21 20:55
mvePete O'Hanlon20-Apr-21 20:55 
Questionc# How to access data in an other object Pin
Frank-Cziryek19-Apr-21 2:29
Frank-Cziryek19-Apr-21 2:29 
AnswerRe: c# How to access data in an other object Pin
OriginalGriff19-Apr-21 2:58
mveOriginalGriff19-Apr-21 2:58 
adatlista is not a variable, it's a class:
C#
class adatlista
    {
        public List<adatok> lista = new List<adatok>();
    }

So you can't access it's list like this:
C#
adatlista.lista.Add(new adatok());

Why not?
Because you need an instance of the class to work with ...

Let's ignore computers for a moment, and talk about cars.
We both have a car: the same make, the same model, the same colour, the same engine, the same age.
I give you a ride to the shops, and while in my car, you put your mobile phone in the glove box.

When you get home again, you need you mobile so you go to your car and open the glove box. Is your phone there?

No, of course not - it's in the glove box in my car. You know that it can only be accessed my opening my car, opening that glove box and reaching in for your phone, because you know that the two vehicles are separate instances of the particular class of black Mercedes A-class cars that they made in 2006.
You know that despite being outwardly identical, they are very different vehicles and that to do anything with them, you have to use the right instance. You want to drive to the airport, you take your car, not mine!

Classes and instances also matter in computers: Car is a class, but "your car" is a Car type variable which holds a Car class instance, "my car" is another Car type variable which holds a different Car class instance.

So you access the List in your adatlista class, you need to create an use a specific instance of that class:
C#
adatlista adat = new adatlista();
adat.lista.Add(new adatok());


There is a way to get what you wrote to work, but ... it's probably something you haven't really covered yet: static classes - so I won't go into that. It's pretty important that you understand instances anyway!

Does that make sense?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

Question.net passive mvp implementation w unity novice questions Pin
Romar Nicholas Mandap18-Apr-21 15:26
Romar Nicholas Mandap18-Apr-21 15:26 

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.