Edmondo 0 Newbie Poster

Hello there, I'm again working with a insertTemplate but this time I would like to know, basically I have two SQL tables one called Technician and the other called Alert.

Basically I have a TextBox where a user can add new employees and save them to the Technician table, the Alert table then needs to have a lot of information entered along with the Technician name, this is automatically populated in a DropDownList from the Technician table.

When I enter all the information in and have the DropDownList populated with the Technician name data the DropDownList does not not save to the Alert database.

I assume this is becuase it is coming in from a different dataSource, is there a way around this so that I can still have the DropDownList populated from the employee table, but then get it to save up to the Alert one?

<td class="style20">
<asp:DropDownList ID="CreatorDownList" runat="server" AutoPostBack="True" 
Text='<%# Bind("Creator") %>' DataSourceID="TechnicianDataSource" 
DataTextField="TechnicianName" DataValueField="TechnicianName" 
                            onselectedindexchanged="CreatorDownList_SelectedIndexChanged">                      
</asp:DropDownList> <asp:SqlDataSource ID="TechnicianDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" 

SelectCommand="SELECT TechnicianName FROM Technician">
                         </asp:SqlDataSource><asp:SqlDataSource

Above is the code for the Technician table

<asp:SqlDataSource ID="sendDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" 
        InsertCommand="INSERT INTO Alerts (SitesAffected, BulletinType, TechnicianDealing, Description, DateTime, SendTo, TextSent, Creator) VALUES (@SitesAffected, @BulletinType, @TechnicianDealing, @Description, @DateTime, @SendTo, @TextSent, @Creator)" 
        SelectCommand="SELECT Alerts.* FROM Alerts">
        <InsertParameters>
            <asp:Parameter Name="SitesAffected" />
            <asp:Parameter Name="BulletinType" />
            <asp:Parameter Name="TechnicianDealing" />
            <asp:Parameter Name="Description" />
            <asp:Parameter Name="DateTime" />
            <asp:Parameter Name="SendTo" />
            <asp:Parameter Name="TextSent" />
            <asp:Parameter Name="Creator" />
         </InsertParameters>
    </asp:SqlDataSource>

And here is the code to save to the Alert table

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.