I need some help. I have a detailsview and it has several different fields in it. The fields I am having a problem with it the dropdownlist. I have two dropdownlist, one that is dependent on the other. That works fine. But now when I try to insert the selected items into my DB it takes the value of the first dropdownlist fine but the second one it just keeps inputting Select Dept Code, which is my default value. I know that I am selecting something, but it just will not take it. I will paste my asp.net and my c# code. Please help. Thank you.
<asp:DetailsView ID="AddRequestDetailsView" runat="server" Height="110px" Width="508px"
DataSourceID="EnterRequestDS" AutoGenerateRows="False" CellPadding="4" DataKeyNames="rAuid"
DefaultMode="Insert" ForeColor="#333333" GridLines="None"
EnableViewState="False" oniteminserting="AddRequestDetailsView_ItemInserting">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
<EditRowStyle BackColor="#999999" />
<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
<Fields>
<asp:BoundField DataField="rAuid" HeaderText="rAuid" InsertVisible="False" ReadOnly="True"
ShowHeader="False" SortExpression="rAuid" />
<asp:BoundField DataField="internalId" HeaderText="internalId" InsertVisible="False"
SortExpression="internalId" />
<asp:TemplateField HeaderText="Employee First Name" SortExpression="Employee First Name">
<InsertItemTemplate>
<asp:TextBox ID="firstNameTxt" runat="server" Text='<%# Bind("employeeFirstName") %>'></asp:TextBox>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Employee Middle Name" SortExpression="Employee Middle Name">
<InsertItemTemplate>
<asp:TextBox ID="middleNameTxt" runat="server" Text='<%# Bind("employeeMiddleName") %>'></asp:TextBox>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Employee Last Name" SortExpression="Employee Last Name">
<InsertItemTemplate>
<asp:TextBox ID="lastNameTxt" runat="server" Text='<%# Bind("employeeLastName") %>'></asp:TextBox>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Employee Start Date" SortExpression="Employee Start Date">
<InsertItemTemplate>
<asp:TextBox ID="startDateTxt" runat="server" AutoPostBack="false" Text='<%# Bind("startDate") %>'></asp:TextBox>
<asp:ImageButton ID="calendarImageBtn" runat="server" ImageUrl="~/Images/Calendar_schedule.png"
OnClick="calendarImageBtn_Click" CausesValidation="False" />
<asp:Calendar ID="startDateCalendar" runat="server" Visible="false" SelectedDate=""
SelectionMode="Day" OnSelectionChanged="startDateCalendar_SelectionChanged" BackColor="#99CCFF"
TitleStyle-BackColor="White"></asp:Calendar>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Department Code" SortExpression="Department Code">
<InsertItemTemplate>
<asp:DropDownList ID="departmentCodeDDL" runat="server" DataValueField="deptCode" AppendDataBoundItems = "true"
AutoPostBack="True" DataBound="MyListDataBound" DataSourceID="DeptSqlDS" DataTextField="deptCode">
<asp:ListItem>Select Dept Code</asp:ListItem>
</asp:DropDownList>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Job Code" SortExpression="Job Code">
<InsertItemTemplate>
<asp:DropDownList ID="jobCodeDDL" runat="server" AutoPostBack="False" DataTextField="jobCode" AppendDataBoundItems = "true"
DataValueField="jobCode" DataSourceID="jobSqlDS" OnSelectedIndexChanged="jobCodeDDL_SelectedIndexChanged"
DataBound="MyListDataBound2" EnableViewState="True">
<asp:ListItem>Select Dept Code</asp:ListItem>
</asp:DropDownList>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Job Title" SortExpression="Job Title">
<InsertItemTemplate>
<asp:Label runat="server" Text="" ID="jobTitleLabel"></asp:Label>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButton ID="standardProfileRB" runat="server" GroupName="Profile" Text="Standard Profile for this Job Code" /><br />
<asp:RadioButton ID="customProfileRB" runat="server" GroupName="Profile" Text="Custom Request" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Special Notes" SortExpression="Special Notes">
<InsertItemTemplate>
<asp:TextBox ID="specialNotesTxt" runat="server" Text='<%# Bind("specialNotes") %>'
TextMode="MultiLine" Height="100" Width="300"></asp:TextBox>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<InsertItemTemplate>
<asp:Button ID="submitBtn" runat="server" CausesValidation="False" CommandName="Insert"
Text="Submit" />
</InsertItemTemplate>
</asp:TemplateField>
</Fields>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
</asp:DetailsView>
<asp:SqlDataSource ID="DeptSqlDS" runat="server" ConnectionString="<%$ ConnectionStrings:UserAccessConnectionString %>"
SelectCommand="SELECT DISTINCT [deptCode] FROM [DeptJobCode]"></asp:SqlDataSource>
<asp:SqlDataSource ID="jobSqlDS" runat="server" ConnectionString="<%$ ConnectionStrings:UserAccessConnectionString %>"
SelectCommand="SELECT [jobCode] FROM [DeptJobCode] where [deptCode] = @deptcode">
<SelectParameters>
<asp:ControlParameter ControlID="AddRequestDetailsView$departmentCodeDDL" Name="deptcode"
PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
<asp:ObjectDataSource ID="EnterRequestDS" runat="server" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAllRequests" TypeName="UserAccessTableAdapters.RequestsTableAdapter">
<InsertParameters>
<asp:Parameter Name="internalId" Type="String" />
<asp:Parameter Name="employeeLastName" Type="String" />
<asp:Parameter Name="employeeFirstName" Type="String" />
<asp:Parameter Name="employeeMiddleName" Type="String" />
<asp:Parameter Name="departmentCode" Type="String" />
<asp:Parameter Name="jobCode" Type="String" />
<asp:Parameter Name="jobTitle" Type="String" />
<asp:Parameter Name="startDate" Type="DateTime" />
<asp:Parameter Name="manager" Type="String" />
<asp:Parameter Name="managerEmail" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:Label runat="server" ID="jsHolder" Font-Bold="True" ForeColor="Red"></asp:Label>
</asp:Content>
C#
protected void AddRequestDetailsView_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
DropDownList dcDDL = (DropDownList)AddRequestDetailsView.FindControl("departmentCodeDDL");
DropDownList jcDDL = (DropDownList)AddRequestDetailsView.FindControl("jobCodeDDL");
EnterRequestDS.InsertParameters["departmentCode"].DefaultValue = dcDDL.SelectedValue;
EnterRequestDS.InsertParameters["jobCode"].DefaultValue = jcDDL.SelectedValue;