The issue is this. Have one table with two others related to it. Now I use the others to display the proper names in the field, which there indexes are stored in the table I want to update the data in. How can I update the data in the main table? Code Follows:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="upd_component.aspx.vb" Inherits="upd_component" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Value="not selected">select a component type</asp:ListItem>
<asp:ListItem>Video Card</asp:ListItem>
<asp:ListItem>Memory</asp:ListItem>
<asp:ListItem>Net Card</asp:ListItem>
<asp:ListItem>Hard Drive</asp:ListItem>
<asp:ListItem>Optical Drive</asp:ListItem>
<asp:ListItem>Processor</asp:ListItem>
<asp:ListItem>Monitor</asp:ListItem>
</asp:DropDownList><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:inventoryDBConnectionString2 %>"
SelectCommand="SELECT Hardrive.model, Hardrive.capacity, Type.name, Manufacturer.name AS Expr1 FROM Hardrive INNER JOIN Manufacturer ON Hardrive.man_id = Manufacturer.man_id INNER JOIN Type ON Hardrive.hd_type_id = Type.type_id" UpdateCommand="UPDATE Hardrive SET capacity = @capacity, model = @model, man_id = Manufacturer.man_id, hd_type_id = Type.type_id FROM Hardrive INNER JOIN Manufacturer ON Hardrive.man_id = Manufacturer.man_id INNER JOIN Type ON Hardrive.hd_type_id = Type.type_id WHERE (Manufacturer.name = @Expr1)">
<UpdateParameters>
<asp:Parameter Name="capacity" />
<asp:Parameter Name="model" />
<asp:Parameter Name="Expr1" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
Height="50px" Width="616px" AllowPaging="True" Visible="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" AutoGenerateInsertButton="True">
<EmptyDataTemplate>
No data is present
</EmptyDataTemplate>
<Fields>
<asp:BoundField DataField="Expr1" HeaderText="Manufacturer" SortExpression="Expr1" />
<asp:BoundField DataField="model" HeaderText="Model" SortExpression="model" >
<HeaderStyle Font-Bold="True" />
</asp:BoundField>
<asp:BoundField DataField="capacity" HeaderText="Capacity (gigs)" SortExpression="capacity" />
<asp:BoundField DataField="name" HeaderText="Type of Connection" SortExpression="name" />
</Fields>
</asp:DetailsView>
</form>
</body>
</html>