I have an Access database which has a table with around 6k records. When I am trying to open it in C# using dataset method, it took around 2 minutes to open. Why is this happening and how can speed it up?
MyDataSet _dataSet = new MyDataSet();
MyDataTableAdapter _myDataTableAdapter = new MyDataTableAdapter();
_myDataTableAdapter.GetData();
Last line tooks a long time (around 2 minutes) to get the data.
I created a strongly type dataset using VS tools (See here: http://msdn.microsoft.com/en-us/library/04y282hb(v=vs.80).aspx).
Then I used the above code to retrieve data out of database. I know that Access is very slow but for 6K record, it should take such amount of time.
The database is local and next to application.
Problem solved: Thanks to Tim for his comment: “the table contains large amounts of binary data” I checked the size of database and it was 64MByte! I checked all tables and there is not any large binary data so there should be some other reasons for database to be such big, so I tried to compress it and now its size is 6Mbyte (reasonable!) and code returns data instantly.