View Single Post
  #10 (permalink)  
Old March 6th, 2007, 03:31 PM
highpointbleed highpointbleed is offline
Registered User
Join Date: Jan 2007
Location: Garland, Texas, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to highpointbleed

I have this wonderfulness...

front aspx page....

                                <asp:Repeater id="dr_results" Runat="server">
    <table width="500">
            <td><b>In Service:</b>
                <%#Container.DataItem("In service")%>
                <asp:DataGrid id="dg_WO" runat="server"
                    AutoGenerateColumns="true" visible="True"
                                                        DataSource='<%# GetDataSource(Container.DataItem("In service"),Container.DataItem("Out of Service"),Container.DataItem("DisplayName"))%>'>
            <td><b>Out Service:</b>
                <%#Container.DataItem("Out of Service")%>

code behind page.....

  Private Sub btn_date_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_date.Click
            With _ADO
                _ADO.SQLStr = "usp_GetStandByTime '" & txt_from.Text & " 3:30:00 PM', '" & txt_to.Text & " 7:00:00 AM'"
                _DataSet = .ReturnDataSet

                dr_results.DataSource = _DataSet.Tables(1)

                pnl_date.Visible = False
                pnl_Report.Visible = True
            End With
        Catch ex As Exception
            lbl_error.Text = "- No Data to Return - " & ex.Message
            pnl_date.Visible = True
            pnl_Report.Visible = False
        End Try
    End Sub

    Public Function GetDataSource(ByVal dataItem1 As String, ByVal dataItem2 As String, ByVal dataItem3 As String) As DataView
        Dim i As Integer = 0
        Dim Inserv As String = dataItem1.ToString
        Dim Outserv As String = dataItem2.ToString
        Dim Employee As String = dataItem3.ToString
        Dim _DataSet As New DataSet
            With _ADO
                _ADO.SQLStr = "usp_GetStandByTimeByEmp '" & Inserv & "', '" & Outserv & "', '" & Employee & "'"
                _DataSet = .ReturnDataSet
                dg_WO.DataSource = _DataSet.Tables(0)
            End With
        Catch ex As Exception
            lbl_error.Text = "--- No Data to Return --- " & ex.Message
            pnl_date.Visible = False
            pnl_Report.Visible = True
        End Try
    End Function

--------------end code---------------

I get "--- No Data to Return --- Object not set to a reference of an object"

Please help!!!!!!!!

smell that - that's tension...