title: objectdatasource insertparameter value
body: <p>i have a page prueba.aspx with this code</p>
  
  <pre><code>protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
      {
          try
          {
  
              Object ob = CPUSControl1.FindControl("ObjectDataSourcecpus");
              ObjectDataSource ods = (ob != null &amp;&amp; ob.GetType() == typeof(ObjectDataSource)) ? (ObjectDataSource)ob : null;
              if (ods != null)
              {
                  ods.SelectParameters.Clear();
                  ods.SelectParameters.Add("usuario", DropDownListUsuarios.SelectedValue.ToString().Trim());
                  ods.InsertParameters.Add("usuario", DropDownListUsuarios.SelectedValue.ToString().Trim());
              }
          }
          catch (Exception error)
          {
              throw error;
          }
  
  
      }
  </code></pre>
  
  <p>CPUSControl1 is a usercontrol in this page and its found ok, the objectdatasource if found ok too. Even de selectedparameters works ok but the insertparameter i add does not work. I've tried to change the name, debugedit step by step and the insertparameters allways takes the defaultvalue(0)
  The objectdatasource is this</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="ObjectDataSourcecpus" runat="server" 
      SelectMethod="getCPUs" TypeName="CPU" InsertMethod="saveCPUs"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:Parameter Name="usuario" DefaultValue="0" Type="String" /&gt;
      &lt;/SelectParameters&gt;
      &lt;InsertParameters&gt;
          &lt;asp:Parameter Name="usuario" DefaultValue="0" Type="String" /&gt;
          &lt;asp:Parameter Name="Codigo" Type="String" /&gt;
          &lt;asp:Parameter Name="NroSerie" Type="String" /&gt;
          &lt;asp:Parameter Name="TipoCPU" Type="String" /&gt;
          &lt;asp:Parameter Name="Mother" Type="String" /&gt;
          &lt;asp:Parameter Name="Modelo" Type="String" /&gt;
          &lt;asp:Parameter Name="Procesador" Type="String" /&gt;
          &lt;asp:Parameter Name="Memoria" Type="String" /&gt;
          &lt;asp:Parameter Name="Proveedor" Type="Int32" /&gt;
          &lt;asp:Parameter Name="BocaRed" Type="String" /&gt;
          &lt;asp:Parameter Name="IP" Type="String" /&gt;
          &lt;asp:Parameter Name="UPS" Type="Int32" /&gt;
          &lt;asp:Parameter Name="VtoGarantia" Type="DateTime" /&gt;
          &lt;asp:Parameter Name="FechaCompra" Type="DateTime" /&gt;
          &lt;asp:Parameter Name="NombreEquipo" Type="String" /&gt;
          &lt;asp:Parameter Name="USB" Type="String" /&gt;
          &lt;asp:Parameter Name="Obs" Type="String" /&gt;
          &lt;asp:Parameter Name="Marcacion" Type="String" /&gt;
          &lt;asp:Parameter Name="TipoCPU1" Type="Int32" /&gt;
          &lt;asp:Parameter Name="fechaentrada" Type="DateTime" /&gt;
          &lt;asp:Parameter Name="fechasalida" Type="DateTime" /&gt;
      &lt;/InsertParameters&gt;
  &lt;/asp:ObjectDataSource&gt;
  </code></pre>
  
  <p>i've been obligated to add the ods.SelectParameters.Clear(); but not a ods.InsertedParameters.Clear();
  why?
  i guess it's because i'm never adding the insertparameters but y cant guess why.
  Thanks in advance. And excuse my bad english</p>