Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is employee_id not being inserted into database
    primarykey
    data
    text
    <pre><code> &lt;asp:TabPanel ID="AbsentTabPanel" runat="server" HeaderText="Excused Absences"&gt; &lt;ContentTemplate&gt; &lt;asp:ListView ID="AbsentListView" runat="server" InsertItemPosition="LastItem" DataSourceID="AbsentSqlDataSource" DataKeyNames=""&gt; &lt;InsertItemTemplate&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:DropDownList ID="ExcusedAbsences_employee_idDropDownList2" runat="server"&gt; &lt;asp:ListItem Text="John Smith" Value="1" /&gt; &lt;asp:ListItem Text="Indiana Jones" Value="2" /&gt; &lt;/asp:DropDownList&gt; &lt;/td&gt; &lt;td&gt; &lt;!-- start date --&gt; &lt;asp:TextBox ID="start_dt_codeTextBox" runat="server" Columns="6" Text='&lt;%#Bind("start_dt")%&gt;' /&gt; &lt;/td&gt; &lt;td&gt; &lt;!-- end date --&gt; &lt;asp:TextBox ID="end_dt_codeTextBox" runat="server" Columns="6" Text='&lt;%#Bind("end_dt")%&gt;' /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Button runat="server" CommandName="Insert" Text="insert" /&gt; &lt;asp:Button runat="server" CommandName="Clear" Text="clear" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/InsertItemTemplate&gt; </code></pre> <p>...</p> <pre><code>&lt;asp:SqlDataSource ID="AbsentSqlDataSource" runat="server" ConnectionString="&lt;%$ ConnectionStrings:Rotations3ConnectionString %&gt;" SelectCommand="SELECT employee_id, start_dt, end_dt FROM Excused_Absences WHERE fy = @fy AND pgy = @pgy" UpdateCommand="UPDATE Excused_Absences SET start_dt = @start_dt, end_dt = @end_dt, employee_id = @employee_id WHERE absence_nbr = @absence_nbr" InsertCommand="INSERT INTO Excused_Absences (fy, pgy, employee_id, start_dt, end_dt) VALUES (@fy, @pgy, @employee_id, @start_dt, @end_dt)" OldValuesParameterFormatString="old_{0}"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter Name="fy" Type="Int32" ControlID="fyTextBox" PropertyName="Text" /&gt; &lt;asp:ControlParameter Name="pgy" Type="Int32" ControlID="pgyTextBox" PropertyName="Text" /&gt; &lt;/SelectParameters&gt; &lt;InsertParameters&gt; &lt;asp:ControlParameter Name="fy" Type="Int32" ControlID="fyTextBox" PropertyName="Text" /&gt; &lt;asp:ControlParameter Name="pgy" Type="Int32" ControlID="pgyTextBox" PropertyName="Text" /&gt; &lt;asp:Parameter Name="employee_id" Type="String" /&gt; &lt;asp:Parameter Name="start_dt" Type="DateTime" /&gt; &lt;asp:Parameter Name="end_dt" Type="DateTime" /&gt; &lt;/InsertParameters&gt; </code></pre> <p>For some reason when I insert John Smith or Indiana Jones, the employee_id is not inserted into the database, I get a NULL value. What am I missing?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload