ASP.NET Error with session key strings
<p>Hey I am trying to convert the following code to VB.NET from this webpage</p>

<p><a href="http://msdn.microsoft.com/en-us/magazine/cc163730.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/cc163730.aspx</a></p>

<p>And have a method converted as such</p>

<pre><code>' Get the order from the session on demand
Private Shared Function GetOrderFromSession(ByVal i As Integer) As ShoppingCartOrder
    Dim session As HttpSessionState = HttpContext.Current.Session

    Dim ID As Integer = 0
    Dim quantity As Integer = 0

    ' note: For simplicity session key strings are dynamically 
    ' created——for performance reasons they should be precreated.
ID = CInt(session(ShoppingCartItemIDKeyBase + i))
quantity = CInt(session(ShoppingCartOrderQuantityKeyBase + i))

    Dim item As ShoppingCartItem = ShoppingCartItem.GetItem(ID)
    Return New ShoppingCartOrder(item, quantity)
End Function
</code></pre>

<p>But getting the error around the lines</p>

<pre><code>        ID = CInt(session(ShoppingCartItemIDKeyBase + i))
    quantity = CInt(session(ShoppingCartOrderQuantityKeyBase + i))
</code></pre>

<p>Error   1   Overload resolution failed because no accessible 'Item' can be called without a narrowing conversion:
    'Public Default Property Item(index As Integer) As Object': Argument matching parameter 'index' narrows from 'Double' to 'Integer'.
    'Public Default Property Item(name As String) As Object': Argument matching parameter 'name' narrows from 'Double' to 'String'. </p>
