title: Indexed Property error
body: <p>While debugging my code I found an inner exception which reads as: </p>
  
  <p>In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.</p>
  
  <p>In sql the script runs smoothly returning all the rows, but in vb it's not returning or finding any rows. I have checked that the primary key is in the table and defined. How can I fix this? I had a proir query which returned rows, but as soon as I added this new query the inner exception came.... I didn't change anything except the querystring.</p>
  
  <p>This is what I've done:</p>
  
  <pre><code>    Public Sub BindDeliveredItems()
      Proir if statemets....
      Else
          queryString = "select distinct LS.[Route], LS.[SubRoute], LS.[Truck], Convert(VARCHAR(10), LS.[Date], 121) AS Date, LS.[DriverAssistantContract]" &amp; _
                          ",((del.CT*100 )/ todel.TCT) as Score" &amp; _
                          "from [Warehouse].[dbo].[LoadSheet] LS" &amp; _
                          "left join (select [Truck],[Date],[Status], count([Status]) CT from  [Warehouse].[dbo].[LoadSheet]" &amp; _
                          "WHERE  status='Delivered'" &amp; _
                          "group by [Truck],[Date],[Status]) Del" &amp; _
                          "on LS.truck=Del.truck and LS.[Date]=del.[Date]" &amp; _
                          "left join (select [Truck],[Date], count([Truck]) TCT from  [Warehouse].[dbo].[LoadSheet]" &amp; _
                          "group by [Truck],[Date]) todel" &amp; _
                          "on LS.truck=toDel.truck and LS.[Date]=todel.[Date]" &amp; _
                          "WHERE ls.[Date] = '2013-07-03'" &amp; _
                          "AND ls.[Truck] = 'BX 39 LK GP'"
      End If
  
     Dim ds As DataSet = GetData(queryString)
      If (ds.Tables.Count &gt; 0) Then
          gvDeliveredItems.DataSource = ds
          gvDeliveredItems.PageSize = (10)
          gvDeliveredItems.AllowPaging = True
          gvDeliveredItems.DataBind()
      End If
  End Sub
  
      Function GetData(ByVal queryString As String) As DataSet
      Dim ds As New DataSet()
      Try
          Dim adapter As New SqlDataAdapter(queryString, SQLCon)
          adapter.Fill(ds)
      Catch ex As Exception
          MessageBox(ex.Message)
      End Try
      Return ds
  End Function
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>The first time the I can see the exception is on this line</p>
  
  <pre><code>    Dim ds As DataSet = GetData(queryString)
  </code></pre>
  
  <p>And on this line the exception shows as well:</p>
  
  <pre><code>    If (ds.Tables.Count &gt; 0) Then
  </code></pre>
  
  <p>My previous sql string work perfect without changing anything. The only thing I changed was the querystring when it started to give me this exception</p>