Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 How to update textbox data in a datagrid

Author  Topic 

shybi
Starting Member

41 Posts

Posted - 2006-08-25 : 02:30:04
how can i update textbox data in a datagrid? when i click on the edit button on the datagrid,it will change all the datacell into textbox,which ever row i clicked.now i want to pass the updated value on click of the update button.

And i also want to write an update statement which have to update values from 5 tables,i am giving the da\etails of 5 tables below

table: Users
field:UserID(PK),FirstName(FK),LastName(FK),DeptID(FK),LocationID(FK),CompanyID(FK),GroupID(FK)

table: DeptDetail
Field: DeptID(PK),Dept

table: LocationDetail
Field: LocationID(PK),Location

Table:CompanyDetail
Field:CompanyID(PK),Company

Table:GroupDetail
Field:GroupID(PK),Groups

I want to write an update statement which contains fields for UserID,FirstName,LastName,Dept,Location,Company,Groups.

how can i write an update statement for it?

shybi

dfiala
Posting Yak Master

116 Posts

Posted - 2006-08-29 : 14:19:30
Here's a detailed discuss of how to work with updates in a datagrid: http://aspnet.4guysfromrolla.com/articles/071002-1.aspx

You cannot write a single update statment to update multiple tables. SQL does not support it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ua-uz_82n9.asp

You need to write one update statement and enclose them with in a transaction. Using a stored procedure or two would be a good idea.

Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page
   

- Advertisement -