DropdownList getting SelectedValue
<p>How do I bind the selected value of the drop down list and assign it to @TimeZone as currently when I select it, @TimeZone is null. </p>

<p>Here is my code:</p>

<p>Within my page load, I have the following code that assigns value to the drop down:</p>

<pre><code>ddlTimeZone.DataSource = from p in TimeZoneInfo.GetZones()
                         select new { p.Id };
ddlTimeZone.DataTextField = "Id";
ddlTimeZone.DataValueField = "Id";             
ddlTimeZone.DataBind();
</code></pre>

<p>Next, within my .aspx file, I have the following:</p>

<pre><code>&lt;EditItemTemplate&gt;
    &lt;asp:DropDownList ID="ddlTimeZone" runat="server"&gt;
    &lt;/asp:DropDownList&gt;
&lt;/EditItemTemplate&gt;
</code></pre>

<p>.....
.....</p>

<pre><code> InsertCommand="INSERT INTO [Companies] ([TimeZone]) VALUES ( @TimeZone)"

 &lt;InsertParameters&gt;                 
        &lt;asp:Parameter Name="TimeZone" Type="String" /&gt;           
 &lt;/InsertParameters&gt;
</code></pre>

<p>Again, what I need to know is how do I assign the value of the selected item in the dropdown list to @TimeZone as currently when I select it, @TimeZone it is null. </p>

<p>I tried </p>

<pre><code> &lt;asp:DropDownList ID="ddlTimeZone" SelectedValue='&lt;%# Bind("TimeZone") %&gt;' runat="server"&gt;
 &lt;/asp:DropDownList&gt;
</code></pre>

<p>but that gave the following error message: </p>

<blockquote>
  <p>'ddlTimeZone' has a SelectedValue which is invalid because it does not
  exist in the list of items. Parameter name: value</p>
</blockquote>
