Just move following section to the outside of the loop. It is refreshing the grid after 1st save operation and thus inserting only 1st row.
dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
Something like-
SqlCommand cmd = new SqlCommand("INSERT INTO Rota (Id, Name, DateWorking) Values (@Id, @Name, @Date)",connection);
cmd.CommandType = CommandType.Text;
connection.Open();
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
cmd.Parameters.AddWithValue("@Id", dataGridView1.Rows[i].Cells["Id"].Value);
cmd.Parameters.AddWithValue("@Name", dataGridView1.Rows[i].Cells["Name"].Value);
cmd.Parameters.AddWithValue("@Date", dataGridView1.Rows[i].Cells["DateWorking"].Value);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear()
}
cmd.Dispose();
connection.Close();
cmd = new SqlCommand("SELECT * FROM Rota");
cmd.CommandType = CommandType.Text;
cmd.Connection = connection;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
Hope, it helps :)