Hello,
I have this tool written for 32bit version entirely in MapBasic. It is supposed to show dialog with user information (name, last name, address...) with list of water consumptions by months. All data presented in dialog are from table "Consumptions" with indexed household IDs, and it takes about 1 sec to select user records, with table itself containing about 670K records (and getting bigger every month).
Now I'm trying to upgrade it a little bit, so I decided to rewrite it using C#. When I got to the part of selecting records, it took cca 12 seconds to make selection:
command = connection.CreateCommand();
command.CommandText = "SELECT * FROM CONSUMPTION WHERE ID = @ID";
command.Parameters.Add("@ID", id);
connection.Open();
var reader = command.ExecuteReader();
Then I tried other way:
var table = Session.Current.Catalog.GetTable("CONSUMPTION");
var si = MapInfo.Data.SearchInfoFactory.SearchWhere("ID = " + id.ToString());
var featureSet = MapInfo.Engine.Session.Current.Catalog.Search(table, si);
Again, it took about 12 seconds. I'm I doing something wrong? Is there any faster way to select records from a larger table?
------------------------------
Miroslav Kovacevic
Knowledge Community Shared Account
------------------------------