Confusion About DataBinding

  • Thread starter Thread starter Ross Holder
  • Start date Start date
R

Ross Holder

Am trying to bind a textbox ASP.NET web control to an UPDATE stored proc in the codebehind and can't seem to get it working. I'm using a dataview, which a SELECT stored proc populates in the codebehind. So the class I built to read from the database is fine. But for some strange reason, the dataview never seems to get passed the user input form the textbox back to the dataview, and thus the update logic while working just fine as far as I can tell, is passing old data.

How should I go about tackling this?

Gratefully,
RH
 
When u do postback the contents of dataview are lost.
do don;t expect that databinding asp.net will automatically send textbox values. you will need to do things manually.

-jignesh.
Am trying to bind a textbox ASP.NET web control to an UPDATE stored proc in the codebehind and can't seem to get it working. I'm using a dataview, which a SELECT stored proc populates in the codebehind. So the class I built to read from the database is fine. But for some strange reason, the dataview never seems to get passed the user input form the textbox back to the dataview, and thus the update logic while working just fine as far as I can tell, is passing old data.

How should I go about tackling this?

Gratefully,
RH
 
Jingesh:
When u do postback the contents of dataview are lost.

Yeah - at one point was hoping to get around the problem by putting the DataView in-session, but then realized that was pretty much the same thing as putting all the data access code in my class's update method. Trying to make this a little more efficient.

do don;t expect that databinding asp.net will automatically send textbox values. you will need to do things manually.

Strange thing is, there are numerous examples of this working fine when the SqlDataAdapter is local and the SQL queries are being sent from the page's codebehind. Of course, I couldn't find any code examples that directly related no my problem (i.e. none showed me a case where an UPDATE query in a stored procedure was bound to a textbox - even via a DataView).

For now, I'm creating some generic code to do this update activity, but was hoping to find a way to just tie the control to the UPDATE stored proc in the class; purpose being to at spome point promote the class in-question to a web service down the road.

Gratefully,
RH
Am trying to bind a textbox ASP.NET web control to an UPDATE stored proc in the codebehind and can't seem to get it working. I'm using a dataview, which a SELECT stored proc populates in the codebehind. So the class I built to read from the database is fine. But for some strange reason, the dataview never seems to get passed the user input form the textbox back to the dataview, and thus the update logic while working just fine as far as I can tell, is passing old data.

How should I go about tackling this?

Gratefully,
RH
 
Back
Top