locked
LookUp Item Store RRS feed

  • Question

  • User-977562321 posted

    i have a table and store lookup item in it.

    my custom checkboxlist get items from my lookup table.

    when select mulit item and click save,insert the selected item in other table with the master record guid id column.

    i think this way is not right way !!!

    plz help me

    Thursday, August 25, 2011 4:51 AM

Answers

  • User-16411453 posted

    That sounds correct, Your primary ID is 1

    You select 1, and update the other table to selectedID = 1

    So if the name changes to the master record, it's still 1, and doesn't break the relation

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, August 27, 2011 1:07 AM

All replies

  • User1266497125 posted

    So what's the question?

    Thursday, August 25, 2011 4:53 AM
  • User3866881 posted

    Hello named.webdev,

    it seems that you wanna something like a Master-Details Saving... e.g:

    Suppose you have a product belonging to a specific category, and you can edit the category from a list from a dropdownlist box to choose with.

    If yes, plz see the sample below:

    http://www.heroicsalmonleap.net/links/DropDownListInGridViewBoundToDataSource.zip

    Here's the codes:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID"DataSourceID="SqlDataSource1">
       <Columns>
          <asp:CommandField ShowEditButton="True" />
         
    <asp:TemplateField HeaderText="ProductName" SortExpression="ProductName">
            
    <EditItemTemplate>
               
    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="ProductName" DataValueField="ProductName" SelectedValue='<%# Bind("ProductName") %>'>
               
    </asp:DropDownList>
               
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [ProductName] FROM [Products]"></asp:SqlDataSource>
            
    </EditItemTemplate>
         
    <ItemTemplate>

     

    Friday, August 26, 2011 10:25 PM
  • User-16411453 posted

    That sounds correct, Your primary ID is 1

    You select 1, and update the other table to selectedID = 1

    So if the name changes to the master record, it's still 1, and doesn't break the relation

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, August 27, 2011 1:07 AM