Question as above. I was told to use list<> to do so, but I still have no clue about how to do it exactly. I am new to C#.
Instead of dataGridView in C# windows application, what should I use for console application to display a table from sql server?
2k Views Asked by AudioBubble At
2
There are 2 best solutions below
0

Doing what jradich1234 did is the most practical approach. You fill a dataset with the table data and then just go through it printing each line and then adding a \n after the last column.
If you really want to use the list<> object (or you have to do it), then the proccess has a little more of work. Basically you have to create the list and then, instead of printing, you add a new item to the list that represents the row... and then you move through the list and do exactly the same jradich1234 did.
It is a good way to practice the use of lists and simple structs, but it is not as efficiend as the previous answer.
You could try something like the very simplified example below...