I see code like the following in several books and examples online. The problem is they all feed in a single method into a dictionary object which requires two.
IDictionary statistics = connection.RetrieveStatistics();
Which returns the IDE error:
Error 1 Using the generic `type 'System.Collections.Generic.IDictionary<TKey,TValue>' requires '2' type arguments C:\Users\SGM7\Documents\ASPX 3_5 book code\Pro ASP.NET 3.5\Chapter07\Website\Tester.aspx.cs 22 9 C:\...\Website\`
So even though connection.RetrieveStatistics() returns pairs, how can I get IDictionary to accept connection.RetrieveStatistics()?
Here's the code block.
connection.Open();
connection.StatisticsEnabled = true;
IDictionary statistics = connection.RetrieveStatistics();
lblBytes.Text = "Received bytes: " + statistics["BytesReceived"].toString();
connection.Close();
lblBytes.Text += connection.State.ToString();