Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Fill TextBox with DataReader...

Reply
Thread Tools

Fill TextBox with DataReader...

 
 
Islam Elkhayat
Guest
Posts: n/a
 
      11-22-2004
In my C# Web Application
I need to fill a textbox with DataReader and use a Next Button to view next
value...
I created the Datareader in the Page_Load but everytime it get result of the
First row.
If i use a While or For loop i get result of the last row...
How can i check "PostBack" to do so our if there is another way to fill the
textbox and use the Next button to see next result rather than DataReader??
thanx


 
Reply With Quote
 
 
 
 
Jay
Guest
Posts: n/a
 
      11-22-2004
you can keep track of the current record number in a variable and store it
either in the view state of the page / Session / Hiden control.
and skip that many records the next time the button_click event is caled.

instead if you don't 've much data returned from the database call , then
you can fill the datatable / dataset and store this in Session also store
the current datarow being displayed and on the next button_click , skip that
many rows. this methood will eliminate multiple database calls everytime the
button_click event is called.


Will this do ?

Jay

"Islam Elkhayat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In my C# Web Application
> I need to fill a textbox with DataReader and use a Next Button to view
> next value...
> I created the Datareader in the Page_Load but everytime it get result of
> the First row.
> If i use a While or For loop i get result of the last row...
> How can i check "PostBack" to do so our if there is another way to fill
> the textbox and use the Next button to see next result rather than
> DataReader??
> thanx
>



 
Reply With Quote
 
 
 
 
Saravana
Guest
Posts: n/a
 
      11-22-2004
Instead of using datareader, you can use dataset. During page_load you can
load the dataset and you can store it in session. When post back occurs you
can find the current record id from hidden field or viewstate and then you
can populate the next record in textbox.

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com


"Islam Elkhayat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In my C# Web Application
> I need to fill a textbox with DataReader and use a Next Button to view

next
> value...
> I created the Datareader in the Page_Load but everytime it get result of

the
> First row.
> If i use a While or For loop i get result of the last row...
> How can i check "PostBack" to do so our if there is another way to fill

the
> textbox and use the Next button to see next result rather than

DataReader??
> thanx
>
>



 
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
Getting an asp.net TextBox to fill a screen and adjust heightdynamically Terry ASP .Net 7 11-16-2011 02:36 PM
How fill the textbox with the DataSet values? Patricio ASP .Net 1 08-24-2006 08:37 AM
fill textbox from new window dfetrow410@hotmail.com ASP .Net 1 07-23-2006 07:04 AM
Datagrid embedded textbox text fill on postback Peppie ASP .Net 0 06-01-2005 06:59 PM
Textbox onchange won't fire after fill-in from popup window? Kathy Burke ASP .Net 1 11-10-2003 08:46 PM



Advertisments