For your issue, you can try to write a stored Procedure which can be used to update data to two tables at first. Then set the UpdateCommand as stored Procedure as follows:
Create two dataset for two different datasource... Then join this using
Dataset.Merge() Method ... Display this joined dataset as the datasource of your gridview..
Mandeep Joon
Participant
1570 Points
387 Posts
How To show Data In Gridview and Update the same
Jan 13, 2013 01:52 PM|LINK
Hi,
I want t show data in gridview from two tables, also want to update the command from gridview edit command.
Mandeep Joon
Blog:- Hightechnology.
sinedyip
Member
308 Points
154 Posts
Re: How To show Data In Gridview and Update the same
Jan 13, 2013 02:40 PM|LINK
Did you chek this article I think it could be helpful for what I understood that you want to perfomr with the GridView.
http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx
Mandeep Joon
Participant
1570 Points
387 Posts
Re: How To show Data In Gridview and Update the same
Jan 13, 2013 03:24 PM|LINK
i am talking here about two tables, i know how to do if i am using 1 table.
Mandeep Joon
Blog:- Hightechnology.
sinedyip
Member
308 Points
154 Posts
Re: How To show Data In Gridview and Update the same
Jan 13, 2013 03:27 PM|LINK
When you say to table do you mean that you get the data from both create a third one and use that one as a DataSource of your GridView?
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: How To show Data In Gridview and Update the same
Jan 18, 2013 08:25 AM|LINK
Hi,
For your issue, you can try to write a stored Procedure which can be used to update data to two tables at first. Then set the UpdateCommand as stored Procedure as follows:
http://www.devasp.net/net/articles/display/1391.html
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store
goel.ankit
Contributor
2531 Points
513 Posts
Re: How To show Data In Gridview and Update the same
Jan 18, 2013 08:33 AM|LINK
you can create a dataview from 2 tables and then use it as datasource for grid
Ankit
(Please select 'Mark as Answer' if my response has helped you.)
Dheerendra
Member
97 Points
60 Posts
Re: How To show Data In Gridview and Update the same
Jan 18, 2013 09:16 AM|LINK
If ,in the both tabel any common field available ,then you can use join for selecting Data from Both Tabel.
geniusvishal
Star
14308 Points
2821 Posts
Re: How To show Data In Gridview and Update the same
Jan 18, 2013 12:24 PM|LINK
Create two dataset for two different datasource... Then join this using Dataset.Merge() Method ... Display this joined dataset as the datasource of your gridview..
My Website
www.dotnetvishal.com