473,513 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't getstring & display datareader

Hi,
I want to display a single record datareader and get a value from it. But I
can't do both together.

After "dim dr as Oledbdatareader=cmCat.ExecuteReader()", the following is
OK(display this single record):
repPage.datasource=dr
repPage.databind
The following is OK(retriving value):
dr.read()
dim thiscat=dr.getstring(1)
But the following is error:
repPage.datasource=dr
repPage.databind
dr.read()
dim thiscat=dr.getstring(1)

Is that after binding,the cursor is at the next after last row, and I can't
get the first row(the only row)?

How can I do both together? Can any one give me a hit?

Thanx
Nakhi
Lijiang,Yunnan,China,Asia

Nov 17 '05 #1
0 1225

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

Similar topics

6
21449
by: Dan V. | last post by:
I would like to create a 2D string list (2D ArrayList ???). I would like to pass in a table or query as a parameter and have both columns transform into a 2D ArrayList. When I sort the one...
0
363
by: Nakhi | last post by:
Hi, I want to display a single record datareader and get a value from it. But I can't do both together. After "dim dr as Oledbdatareader=cmCat.ExecuteReader()", the following is OK(display this...
2
4089
by: Lee Walters | last post by:
Hi All I'm doing a 'select * from table' in my DataReader below and populating an array with the results. Obvisouly I'm only getting the first field from the results by the use of the...
0
1229
by: pbd22 | last post by:
Hi. I am returning to an old bit of code in our program and need to figure out how to sort my columns on bind. I am sorting on Date (mostly) and some other values. Problem is, the code is an...
0
7161
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...
0
7384
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
7525
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
5686
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,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
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...

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.