Or ... just use the DataTable you already have:
DgTotalInputDataSource = dt;
But ... if it's taking a
really long time, it's also likely that you have far too much data. You should never show more than around 100 to 200 rows to a user: If you have more it becomes increasingly hard to find the data they are interested in. Instead, page the data, provide filters and searches, make the user's life easier.