how to store gridview contents into database table
<p>I Have a gridview with just one column. I have written code like</p>

<pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        SqlConnection con = new SqlConnection(strConnString); 
        con.Open();

        for (int i = 0; i &lt; GridView1.Rows.Count; i++)
       {
            string Users = GridView1.Rows[i].Cells[0].Text;

            string strQuery = "insert into Table1 (FileName, DateTimeUploaded, Type, Username)" +
            " values(@FileName, @DateTimeUploaded, @Type, @Username)";
            SqlCommand cmd = new SqlCommand(strQuery);

            cmd.Parameters.AddWithValue("@FileName", datalink);
            cmd.Parameters.AddWithValue("@Type", ext);
            cmd.Parameters.AddWithValue("@DateTimeUploaded", DateTime.Now);
            cmd.Parameters.AddWithValue("@Username", Users);

            cmd.CommandType = CommandType.Text;
            cmd.Connection = con;
            cmd.ExecuteNonQuery();

       }
        con.Close();
        con.Dispose();

          }
</code></pre>

<p>If this gridview has 2 rows, then the first row is stored in database twice. If gridview has 3 rows then the first row is stored thrice. How can I solve this?</p>
