Click here to Skip to main content
15,399,440 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have never understood writing to a console. I have created a data table but need to view it to make sure I am saving the correct data in the correct order.

I found a example on Microsoft's on-line help but it requires writing to the "console".

I have no idea what the Console in this setting is supposed to be.

I am working on a windows10 PC using Visual Studio 2017, VB.Net

If you know how to do this, or another way to display the data table on the monitor, I would be grateful.

What I have tried:

Searched on line with Bing, searched Microsoft's on-line explanation, tried Wikipedia.
Updated 25-Mar-21 11:07am

1 solution

Unless you are writing a Console app (instead of a WPF or WinForms app) you don't normally have a console - instead Console.Write commands write to the Output pane of the debugger (as do Debug.Write commands).

It is possible to add a Console to a WinForms app, but for production you probably don't want that - it's really meant for debugging development code.

So if you really, really want to see what is in a DataTable in dev then you can use Console.Write and view the Output pane - but you can just look at the DataTable directly in the debugger anyway, so most of the time you don't need to, the debugger is a lot more flexible that just writing strings can ever be!

For production, you'd use a DataGridView or similar and set the DataSource as the DataTable - it's show the data automatically.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900