ReverseDataBind

  • Thread starter Thread starter Peter Morris [Droopy eyes software]
  • Start date Start date
P

Peter Morris [Droopy eyes software]

DataBind() will move data from my source object into the GUI, but is there a
way to automatically reverse this data flow, or do I need to write code like
this?

MyPerson.Name = NameTextBox.Text;


Thanks

Pete
 
The new DataSource controls, with the new data bound controls in ASP.net 2.0
come as close to this as you can get.
 
Well without going into too much detail...

There are some new controls: SQLDataSource, AccessDataSource ,
ObjectDataSource , XMLDataSource and SiteMapDataSource. You can then bind
these to the various new databound controls by simply using the DataSourceID
property. The datasource controls have a number of properties such as
SelectCommand, UpdateCommend etc. that you can set to various SQL queries toi
perform the SELECT, UPDATE, INSERT and DELETE actions you want. That way you
can have a databound control, that keeps it's viewstate and can read, edit,
insert and delete records without actually writing any code at all. Of
course it gets a bit more complex if you want to do anything very usefull
such as validating the users input etc, but it's still much much easier than
ASP.net 1.1
 
Ah, that's no use to me then. The datasources in my case are object
instances and not datasets or RDBMS tables :-(
 

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

Back
Top