473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help - Console.WriteLi ne(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.WriteLi ne(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 1826
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.WriteLi ne(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.c omwrote:
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.WriteLi ne(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.co m>
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.WriteLi ne(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.ReadLin e();

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
2519
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. The scenario is this: 1.) Set up SqlConnection and SqlCommand 2.) Set SqlDataReader equal to the return value from SqlCommand.ExecuteReader
4
2221
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 data</tag1> (embedded \n character) <tag2>some more data</tag2>" Does the framework provide anything to easily parse this text to get at the
1
1838
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 with a short XML data example. Thanks, Michael Heitland
2
2982
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 is reading and is a text field. I am getting an invalid cast error when the field is null/empty.
2
4383
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
1321
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 parts of it using session variables and got no where. The (Pseudo) code that doesn't work at all is as follows: Page_Load( ) { if ( !IsPostBack )
9
2631
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 storedprocedure that always give the 0 value of the type. - Create an if statement around every assignment. Maybe someone else have an idea?
1
273
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 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()) {
3
3099
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 sqlinternalconnection... how do i fix this code or is there something i need to change in vb or the sql server settings themselves? string pName = textBox6.Text.Trim(); string pMobile1 = textBox5.Text.Trim(); string pHome =...
0
8407
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8512
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.