473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accessing the output from Console.Writeline

What does Console.Writeline do? I'm going through some exercises in a
book and it uses this command frequently to show the results of code
execution. On my system, nothing happens, however. How do I access
this data?

Thanks,
Randy

Apr 26 '07 #1
4 6872
On Apr 26, 5:04 pm, Randy <spam.eastl...@gmail.comwrote:
What does Console.Writeline do? I'm going through some exercises in a
book and it uses this command frequently to show the results of code
execution. On my system, nothing happens, however. How do I access
this data?

Thanks,
Randy
Console.Writeline outputs to a command window. your application must
compile to a console app inorder to see this. If you are using one of
the visual studio suites, console apps are listed as a project
template when you create a new project. You can also output to your
immediate window by using debug.writeline in a windows app running
debug mode.

Apr 26 '07 #2
Thanks. Sorry to be an idiot, but what is supposed to be the result
of the debug.writeline statement? I changed my code and stepped
through each line. Everything compiles and executes correctly, but
that line seems to have no result. Here is the code - very basic:

Dim strSQL As String
strSQL = "SELECT OrderID, CustomerID FROM Orders"
Dim da As New SqlDataAdapter(strSQL, cn)
Dim ds As New DataSet
cn.Open()
da.Fill(ds, "Orders")

Dim strDebug As String
For Each col As DataColumn In ds.Tables("Orders").Columns
strDebug = col.ColumnName.ToString + " , " +
col.DataType.ToString
Debug.WriteLine(strDebug)
Next col
cn.Close()

Thanks, again.
Randy

Apr 27 '07 #3
Figured it out. For any other rookies like me that might stumble onto
this post, the way to view the debug.writeline output is to display
the Output window. This can be done by clicking View - Other Windows
- Output Window or Ctrl-Alt-O.

Thanks for your help.

Apr 27 '07 #4
"Randy" <sp***********@gmail.comschrieb:
What does Console.Writeline do? I'm going through some exercises in a
book and it uses this command frequently to show the results of code
execution. On my system, nothing happens, however. How do I access
this data?
Make sure the project type is set to "Console Application". The output will
apear in a console window then.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Apr 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MIchele | last post by:
Hi I want to access via VB.Net the active directory I want to list all the users and groups in AD and, if it's possible, also the exchange mailbox of each users.. Anyone can help me? Please... ...
2
by: Boba | last post by:
Hi, I'm programming a WinForm application. I would like to enter commands that will send output that will help me to locate bugs in the future. I know that there is a way to send output by...
5
by: Mike Oliszewski | last post by:
Given the following c# code: namespace Company2 { public class SomeFunctions { public void FunctionA() { // Do Something. }
3
by: Liren Zhao | last post by:
I use some "Console.WriteLine(some strings here)" to display some debug information in my winform program. How can I get the information in my programe or same them in a text file ?
4
by: garyusenet | last post by:
Hi. I am trying to learn about array lists, and found an example on MSDN. I tried to compile it but it's not producing any output. I can't see why. Any ideas? Here is what I did. 1....
0
by: shravagiparag | last post by:
Hello, I am developing a console application to invoke gdb session and log in the communication between my application and gdb. I opened gdb as a new process and tried to redirect the input and...
10
by: vel | last post by:
Hi, My program is access the remote system's command prompt through C# program. I can do it. But problem is alignment of that output. can any one give idea to align that output ?. here is...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I...
1
by: mquincey | last post by:
One of the features offered by .NET 2.0 is the use of the TraceSource class. In an attempt to demonstrate its use, I wanted to run my test under the following conditions: 1. Use TraceSource class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.