Skip to main content

All Questions

Tagged with
0 votes
0 answers
43 views

How to iterate rows one by one of my database in WinForms DataGridView window

I want my method to be able to display one by one row on DataGridView by clicking button with MoveNext() method. With this code below it works only partially. When I'm clicking on the button I always ...
tomi's user avatar
  • 11
-2 votes
1 answer
57 views

retrieve variable name in iterator

I have a very basic class in C# and I've implemented an iterator to cycle all its string values (variables), here is the foreach code: string strList = ""; foreach (string param in vars) { ...
elnath78's user avatar
  • 137
1 vote
5 answers
155 views

Conditionally use a varied number of items in each iteration

I guess this is really simple and just involes the use of a iterator and .MoveNext() method. But let's say you are iterating through a collection, you do some work on the collection but based on some ...
Ingó Vals's user avatar
  • 4,898
1 vote
1 answer
479 views

Iterate a File System starting from C:\ root directory?

I am very close to finishing this project however I have a problem that I cannot figure out. If I run my program and start the iteration in My Documents for example. Everything works perfectly. The ...
broguyman's user avatar
  • 1,426
0 votes
3 answers
307 views

File System Iterator Write Results to CSV?

I'm trying to write a file system iterator as a simple Windows Application. I will post what I have so. The problem is that when I select the "C:\" for iteration the app locks up. If I select a ...
broguyman's user avatar
  • 1,426
161 votes
13 answers
97k views

Is if(items != null) superfluous before foreach(T item in items)?

I often come across code like the following: if ( items != null) { foreach(T item in items) { //... } } Basically, the if condition ensures that foreach block will execute only if ...
Sarfaraz Nawaz's user avatar
4 votes
5 answers
3k views

How do I iterate through instances of a class in C#?

Is there a way to iterate over instances of a class in C#? These instances are not tracked or managed in a collection.
Asaf's user avatar
  • 133