Thread: Bind a Label
View Single Post
 
Old January 9th, 2007, 02:21 PM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Here is the problem: a datareader only contains data while you have a connection open to the database so returning a datareader from a function does you no good at all. You either A) have to return a datatable/set or B) Return a string value from your query. You will NOT be able to access any data outside of the above function using a datareader.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature