I added a return to end of my Task method:
private async Task Zugänge(string period1, string period2)
{
string C = ConfigurationManager.ConnectionStrings["123"].ConnectionString;
using (var con = new SqlConnection(C))
using (var cmd = new SqlCommand())
{
cmd.Connection = con;
cmd.CommandText = ("[dbo].[spInfo]");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Periode2", period2);
cmd.Parameters.AddWithValue("@Periode1", period1);
await con.OpenAsync();
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataTable datatable = new DataTable();
adapter.Fill(datatable );
await Task.Run(() => adapter.Fill(datatable ));
return dt;
}
}