public ResultsDataStructure(ref Database db) { data = db.select("tblSnippets", "*", 2, null, null); try { for (int i = 0; i < data.Count; i++) { sorted_names.Add(new KeyValuePair<string,int>(data.ElementAt(i)[0].ToLower(), i)); } } catch { } sorted_names.Sort(CompareKey); int counter = 0; while (counter < sorted_names.Count && getChar(counter) < 'a') { counter++; } for (char c = 'a'; c <= 'z'; c++) { beginning_character[c] = -1; while (counter < sorted_names.Count && getChar(counter) < c) { counter++; } if (counter < sorted_names.Count && getChar(counter) == c) // if found match { beginning_character[c] = counter; } } match = new char[20]; match_len = 0; max_index = sorted_names.Count - 1; }
public Form2(ref Database db1) { InitializeComponent(); db = db1; }