Hi there,
In ADO.NET, the Read method takes care of EOF and MoveNext at the same time. So, your code probably works as expected when it comes to the database. However, look at this:
TextBox1.Text = dr(0).ToString()
You're overwriting the Text on each iteration. Try this instead:
TextBox1.Text += dr(0).ToString()
This adds the data for each record to the current Text.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.