/ Published in: C#
Methinks this is a bad idea but it is a suggested use of generics from the .NET 2.0 Generics Wrox book
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static Dictionary<X, G> BuildDictionary<X, G>(string db, string keyColumn, string valColumn) { while (rd.Read()) { myDictionary.Add((X)rd[keyColumn], (G)rd[valColumn]); // ? good idea? } rd.Close(); return myDictionary; }
URL: http://hobbitwerk.brinkster.net