0

I´m using a gridview to display data from a sqldadasource, when i select a column a detailsview display all the fields and enables editing, i have changed the edittemplatefield and i have a dropdownlist with another sqldatasource that populates the drop and i bind the select value to the field and updates with no problem. The problem is i need at same time, when i select value 1, i have to update a diferent sql table and change status of the vehicleto 0, how can i do that??

Do you mean a printscreen or code??? What i want seems simple, but i can´t see one silpme solution: i have a table with car´s (carTable), with this fields (id, car_description, status), the status have 2 possible values (1 - free,0 - taken), and then i have a requestCar table with fields (Id, User,Car, StartDate, EndDate, status(aproved,reject, pending)), when someone fills the request form, the status(field of table resquestCar) is set to pending and the field car is empty, then the administrator have a administration form where aprove request is one of the menus, and all the request´s with status pending are displayed in a gridview (sqldatsource to table requestCar) with select enabled, when i select one request a details view with all the fields is displayed with edit option and only 2 options are enable in edittemplate (car and status), car is a dropdownlist with sqldatasource2 (sqldatasource table tableCar) that fill the dropdown values (text= carTable.name value= carTable.id) and SelectedValue='<%# Bind("car") %>', when I update in the table requestCar the fields status and car are correct (status= approved and car= cartable.id) the problem is e nedd to set the status in table tableCar to 0 (taken) and I can´t see how do I do it ????

Thanks

  • Is it possible for you to post a screen shot of what you have, so I can get a clearer picture of what you're trying to do? – The Muffin Man Mar 30 '11 at 16:56
  • @Nick - Do you mean a printscreen or code??? What i want seems simple, but i can´t see one silpme solution: – Jose Afonso Mar 30 '11 at 17:02
  • @Jose, Either or is fine, I just want to be sure I can relate my answer as close to how your code is set up. – The Muffin Man Mar 30 '11 at 17:16
  • @Nick I change the question, because i can´t type more than 560 characters, it´s my first time in this forum and i don´t know very well how to use it, forgive my english but i´m form Portugal and sometimes i have to improvise....:) – Jose Afonso Mar 30 '11 at 17:30
  • @Jose, just so you know when you want to put code in your question you can select it and click the button that looks like "{ }" – The Muffin Man Mar 30 '11 at 17:38
  • Do it at SQL level like shown here: http://stackoverflow.com/questions/175066/sql-server-is-it-possible-to-insert-into-two-tables-at-the-same-time – gbs Mar 30 '11 at 18:09

0 Answers0