In the "create" view there is a form in which there are two fields: the date and the document number.
They are common to all lines, and you can clone 2 fields number and name using the button + line (the cloning function works), using the loop in this function, I created 100 lines to fill in (number and names).
On the server in the Post method, I accept all form values using the Form Collection.
Here I implement adding rows to the server using a table parameter:
DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Name", typeof(string)); for (int i = 1; i <= rowCount; i++) dt.Rows.Add(i, $"Name {i}"); using (var cmd = new SqlCommand()) { cmd.Connection = connection; cmd.CommandText = @"insert into [Table] (ID, Name) select ID, Name from @data"; var p = new SqlParameter("@data", SqlDbType.Structured); p.TypeName = "dbo.TableType"; p.Value = dt; cmd.Parameters.Add(p); cmd.ExecuteNonQuery(); } Actually how to measure the execution time of this monster?