i want to pass the pk from table1 into table 2, i think i have the select bit right but how do i get it to insert into table 2...
here is my code...
<
form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="tableID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="tableID" HeaderText="tableID" InsertVisible="False" ReadOnly="True"
SortExpression="tableID" />
<asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
<asp:BoundField DataField="phone" HeaderText="phone" SortExpression="phone" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
InsertCommand="INSERT INTO Table1 (name, phone) VALUES (@name, @phone); SELECT SCOPE_IDENTITY()"
SelectCommand="SELECT * FROM [Table1]">
<InsertParameters>
<asp:controlParameter Name="name" ControlID="name" Type="String" />
<asp:controlParameter Name="phone" ControlID="phone" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="name" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:TextBox ID="phone" runat="server"></asp