refresh sql reader

I have a reader I built using a programatic table with a update button.
I have a price field and a extended price, When I update the quantity the extended quantity field suppose to update.
This is in the storedprocedure. But the reader does not update physically on the client side, or show unless you hit the button twice, i tried ispostback not ispostback.
 Dim tb1 As New Button
 While sqlDR.Read

 Private Sub Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
   
LVL 9
Seven priceFull StackAsked:
Who is Participating?
 
Bob LearnedCommented:
Data readers are tricky in ASP.NET, and I can't see how you are really using it, and the question doesn't really make sense...
0
 
sybeCommented:
> But the reader does not update physically on the client side

Because the client receives static HTML. There is only a connection between database and generated HTML at the moment the HTML is generated. In order to renew the content, the client must do a new request to the server.
0
 
Seven priceFull StackAuthor Commented:
Dim conn As New SqlConnection
conn = New SqlConnection
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Seven priceFull StackAuthor Commented:
I triyed a new connection to server but still not effective
0
 
sybeCommented:
I am getting confused. You need to elaborate your question. Probably for you it is very clear what you ask, but for me it isn't.
0
 
Seven priceFull StackAuthor Commented:
Ok check this out, I have a update button with a text box programatically created.
When I enter a value into the text box and click the update button I have a price called extended price. That is suppose to give the total multiplyied by the quantity.
I just did another test and it is always one step behind. so if I update the text box 2 and click update the extendprice does not change but if I click the button again it then changes on the client side. On the back end it is updated after the first click.  first one click on from quantity 2 to 1ScreenHunter-03-Dec.-16-09.48.gif
0
 
Seven priceFull StackAuthor Commented:
0
 
sybeCommented:
Sounds like doing things in the right order: first update the database then pull the new data (and not vice-versa). But it is unclear how you are pulling data from the database.
0
 
Seven priceFull StackAuthor Commented:
thats ok its just a basic reader in a do while loop with a stored procedure connection open and cmd.
0
 
Seven priceFull StackAuthor Commented:
ooo
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.