This is how I try to load the data:

var cmd = new OleDbCommand($"select count(*) from {tableName}", connection); RowsCount = (int)cmd.ExecuteScalar(); 

But even on such a seemingly simple request - everything hangs tightly. Specifically, this table is quite large (about 60 MB), but this is a count request! But with other tables, everything works without problems (but they are smaller). Tell me what to do?

upd. Can you tell me how you can somehow pierce the insides of OleDB? Maybe this will help to understand the cause of the hang.

  • Use asynchrony, i.e. use ExecuteScalarAsync () - Bulson 8:49 pm
  • @Bulson and where is the asynchrony? If the synchronous option does not work, then the asynchronous one will not work either - PECHAILTER
  • And what you do not like asynchronous request? It will prevent freezing. Just think the data will appear in a couple of minutes (hours). Another option is to limit the selection of 100 (1000) lines - ArchDemon
  • @ArchDemon is another one ... I wrote in Russian that the problem is not the duration of the request. The request simply does not pass. If the same query is run from the management tool of this subd, then everything works out in a second. - PECHAPTER
  • "Everything hangs tight" for your information - this is blocking the interface drawing stream by your request. What does "Request simply fail"? You have in the program is Gandalf, who shouts "You will not pass!" ? - ArchDemon 3:42 pm

0