Is there a way to input two update queries for the gridview UpdateCommand? I used an inner join for gridview so that I would be able to show all of the pertinent information about the Administrator from the tables Admin and Login. Now what I want to do is to be able to update all of the fields that are available in the gridview. I know you can not update two tables with one query so I have tried to write two queries instead without success.
<asp:GridView ID="gvAdminAccounts" runat="server" Width="200px" AutoGenerateColumns="False"
DataSourceID="AccessDataSource1">
<Columns>
<asp:BoundField DataField="Admin_Lname" HeaderText="Last Name"
SortExpression="Admin_Lname" />
<asp:BoundField DataField="Admin_Fname" HeaderText="First Name"
SortExpression="Admin_Fname" />
<asp:BoundField DataField="Admin_Email" HeaderText="Email"
SortExpression="Admin_Email" />
<asp:BoundField DataField="Login_Password" HeaderText="Password"
SortExpression="Login_Password" />
<asp:BoundField DataField="Login_SecurityCode" HeaderText="SecurityCode"
SortExpression="Login_SecurityCode" />
<asp:BoundField DataField="Access" HeaderText="Access"
SortExpression="Access" />
<asp:CommandField HeaderText="Edit" ShowEditButton="True" ShowHeader="True" />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/NiftyCreations.mdb"
SelectCommand="SELECT Admin.*, Login.Login_Password, Login.Login_SecurityCode, Login.Access FROM (Admin INNER JOIN Login ON Admin.Admin_Email = Login.Admin_Email)"
UpdateCommand="Update [Admin] SET [Admin_Lname] = @Admin_Lname, [Admin_Fname] = @Admin_Fname, [Admin_Email] = @Admin_Email Where [Admin_Email] = @Admin_Email;
Update [Login] SET [Login_Password] = @Login_Password, [Login_SecurityCode] = @Login_SecurityCode, [Access] = @Access Where [Admin_Email] = @Admin_Email">
</asp:AccessDataSource>