public async Task<DataTable> ReadTable(SqlConnection conn, string query) { using var cmd = conn.CreateCommand(); cmd.CommandText = query; var table = new DataTable(); table.BeginLoadData(); table.Load(await cmd.ExecuteReaderAsync()); table.EndLoadData(); return table; }
472900cookie-checkC# read a DataTable