473,406 Members | 2,259 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,406 software developers and data experts.

Need help - Console.WriteLine(rdr[0]);

Hello,

I am using Visual Studion.net 2003 to run and test a small program
that supposed to be tested in a word document. I got the connection
and using a data reader to read the data. It executes fine but I don't
see the results in command prompt beacuase I use VS.net 2003 to run
the program.

while (rdr.Read())
{
Console.WriteLine(rdr[0]);
}

Is there a place where I can see these results printed in the IDE? If
I will have to modify the above print line please advice how should I
do that.

thanks
-L

Apr 26 '07 #1
3 1804
Learner wrote:
Hello,

I am using Visual Studion.net 2003 to run and test a small program
that supposed to be tested in a word document. I got the connection
and using a data reader to read the data. It executes fine but I don't
see the results in command prompt beacuase I use VS.net 2003 to run
the program.

while (rdr.Read())
{
Console.WriteLine(rdr[0]);
}

Is there a place where I can see these results printed in the IDE? If
I will have to modify the above print line please advice how should I
do that.
You could use Debug.WriteLine instead if compiled with debug.
--
Tom Porterfield
Apr 26 '07 #2
Learner <pr****@gmail.comwrote:
I am using Visual Studion.net 2003 to run and test a small program
that supposed to be tested in a word document. I got the connection
and using a data reader to read the data. It executes fine but I don't
see the results in command prompt beacuase I use VS.net 2003 to run
the program.

while (rdr.Read())
{
Console.WriteLine(rdr[0]);
}

Is there a place where I can see these results printed in the IDE? If
I will have to modify the above print line please advice how should I
do that.
What kind of application is it? If it's a console application, you
should get a console window up when you run it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 26 '07 #3
Learner wrote:
I am using Visual Studion.net 2003 to run and test a small program
that supposed to be tested in a word document. I got the connection
and using a data reader to read the data. It executes fine but I don't
see the results in command prompt beacuase I use VS.net 2003 to run
the program.

while (rdr.Read())
{
Console.WriteLine(rdr[0]);
}

Is there a place where I can see these results printed in the IDE? If
I will have to modify the above print line please advice how should I
do that.
Try put a:

Console.ReadLine();

at the bottom of your Main.

Arne
Apr 28 '07 #4

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

Similar topics

0
by: James Hokes | last post by:
Hi All, We're using the 1.1. Framework against SQL Server 2000, and are having a strange issue where we don't get errors back from the stored procedure, i.e. the exception never gets thrown. ...
4
by: JezB | last post by:
I have a string which contains some xml text (either in one long line or split into one line per data element), eg. "<tag1>some data</tag1><tag2>some more data</tag2>" or "<tag1>some...
1
by: Michael Heitland | last post by:
Hello everybody, I saw the following code from MS and really have no idea, why the attributes have to be parsed twice. Can I omit the second loop? If I lose some data, please explain it to me...
2
by: James | last post by:
.... Dim rdr As OleDbDataReader = cmd.ExecuteReader If rdr.GetString(1).ToString.Length > 0 Then Console.WriteLine(rdr.GetString(1).ToString) End If The field is in an MS Access table that rdr...
2
by: James | last post by:
.... rdr = cmd.ExecuteReader() Do While rdr.Read() For i = 0 To rdr.FieldCount - 1 If Not rdr.IsDBNull(i) Then Console.WriteLine(rdr.GetString(i)) End If Next Loop
4
by: Paul Rogers | last post by:
I have an existing .NET ( 1.1) application, and I ran Microsoft's FxCop on it, and it screamed at me about directly using textbox.text values instead of session values. So, I tried to re-write...
9
by: patrick.sannes | last post by:
Hi, I have a question. I have a stored procedure that can give a value like a string or an int. But in some cases it can be DBNull. What is the standard way to handle this? - I can create a...
1
by: Learner | last post by:
Hello, I am using Visual Studion.net 2003 to run and test a small program that supposed to be tested in a word document. I got the connection and using a data reader to read the data. It...
3
by: zakuro | last post by:
I've been trying to open a connection to my sql database so i can add new rows and make edits to already existing rows. On the ~conn.Open();~ part i keep getting an expection thrown about the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.