title: Multiple insert data to database using ASP.NET web form
body: <p>I want to insert multiple data to database by code like this :</p>
  
  <pre><code>protected void btnInsert_Click(object sender, EventArgs e)
          {
              int i = 0;
              gvHitung.DataBind();
              int Loop = gvHitung.Rows.Count;
              while (i &lt; Loop)
              {
                  DataView dv = (DataView)sdsHitung.Select(DataSourceSelectArguments.Empty);
                  DataRowView drv = dv[i];
                  string Kd_Modul = drv["Kd_Modul"].ToString();
                  sdsDataNilai.InsertParameters.Add("Binusian_Id",tbBinId.Text);
                  sdsDataNilai.InsertParameters.Add("Kd_Jurusan",tbKdJur.Text);
                  sdsDataNilai.InsertParameters.Add("Angkatan",tbAngkatan.Text);
                  sdsDataNilai.InsertParameters.Add("Kd_Modul",Kd_Modul);
                  sdsDataNilai.Insert();
                  i++;
              }
              gvDataNilai.DataBind();
          }
  </code></pre>
  
  <p>but finally got error message </p>
  
  <blockquote>
    <p>"The variable name '@Binusian_Id' has already been declared. Variable
    names must be unique within a query batch or stored procedure."</p>
  </blockquote>
  
  <p>when I redebug the program, I just saw I record saved. do you have any idea?</p>