Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > can't getstring & display datareader

Reply
Thread Tools

can't getstring & display datareader

 
 
Nakhi
Guest
Posts: n/a
 
      07-15-2003
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find size of GetString in DataReader (vb.net) =?Utf-8?B?TGVlIFdhbHRlcnM=?= ASP .Net 2 01-04-2005 09:17 AM
GetString .net equivelant?? DaveF ASP .Net 0 06-14-2004 11:21 AM
GetString for .net DaveF ASP .Net 1 06-11-2004 04:57 PM
encoder.GetString() help iMonkey ASP .Net 0 07-31-2003 01:37 PM
datareader.getstring(0) error Nakhi ASP .Net 3 07-15-2003 06:41 AM



Advertisments