When I try to compile this code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Get data from the data tier
If Not IsPostBack Then
Dim dsVehicles As DataSet
Dim objData As New CarsData
dsVehicles = objData.getVehicles
Session("DataSet") = dsVehicles
dlVehicles.DataSource = dsVehicles
Me.DataBind()
End If
End Sub
Public Function getVehicles() As DataSet
daVehicles.Fill(DsVehicles1)
Return DsVehicles1
End Function
I get the following error:
Exception Details: System.IndexOutOfRangeException: Index 0 is not non-negative and below total rows count.
Source Error:
Line 16: runat="server">
Line 17: <ItemTemplate>
Line 18: <asp:LinkButton id=btnManuf runat="server" Text='<%# DataBinder.Eval(DsVehicles, "Tables[Vehicle].DefaultView.[0].Manuf_Name") %>'>
Line 19: </asp:LinkButton>
Line 20:<asp:LinkButton id=btnModel runat="server" Text='<%# DataBinder.Eval(DsVehicles, "Tables[Vehicle].DefaultView.[0].Model") %>'>
Any idea what may be causing this issue? Thanks.