can't getstring & display datareader

N

Nakhi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top