Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying console output?

I am currently creating a customer application for a local company. I have a datagridview linked to the customers table, and I am trying to link it up so that updates, inserts and deletions are handled correctly. I am very new to c# so I am starting with the basics (like about 2 days ago I knew nothing - I know vb.net, Java and several other languages though..).

Anywho from what I understand anything output through Debug.WriteLine should only appear when in debug mode (common sense really) but anything output through Concole.WriteLine should appear whether or not in debug mode. However I have checked the immediate and output windows and nothing is being output when in normal mode. Does anyone have any idea why this is??

Edit: I have event handlers for clicking a cell - it should output CellClicked and set the gridview to invisible when a cell is clicked. The latter works whichever mode I am in, but CellClicked is only output in debug mode. I am using Console.WriteLine("CellClicked").

Edit: Seems I may have solved it - I just set the output to Console Application in the project settings pages. It now opens a command line window as well as a windows form, but I can change the output back again when I compile for distribution. Thanks for the help.

like image 958
ClarkeyBoy Avatar asked Dec 23 '22 02:12

ClarkeyBoy


1 Answers

Console.WriteLine() outputs to the console window in the case of a console app only.

You are probably looking for Trace.WriteLine().

like image 169
John Gietzen Avatar answered Dec 28 '22 10:12

John Gietzen