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
Default

I have this wonderfulness...

front aspx page....

                                <asp:Repeater id="dr_results" Runat="server">
<ItemTemplate>
    <table width="500">
        <tr>
            <td><b>Employee:</b>
                <%#Container.DataItem("DisplayName")%>
            </td>
            <td><b>In Service:</b>
                <%#Container.DataItem("In service")%>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DataGrid id="dg_WO" runat="server"
                    CellPadding="3"
                    BorderColor="#999999"
                    BackColor="White"
                    Font-Size="X-Small"
                    Width="874px"
                    GridLines="Vertical"
                    BorderWidth="1px"
                    BorderStyle="None"
                    AutoGenerateColumns="true" visible="True"
                                                        DataSource='<%# GetDataSource(Container.DataItem("In service"),Container.DataItem("Out of Service"),Container.DataItem("DisplayName"))%>'>
                </asp:DataGrid>
            </TD>
        </TR>
        <tr>
            <td><b>Out Service:</b>
                <%#Container.DataItem("Out of Service")%>
        </td>
                                            </tr>
                                        </TABLE>
</ItemTemplate>
</asp:Repeater>


code behind page.....

  Private Sub btn_date_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_date.Click
        Try
            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)
                dr_results.DataBind()

                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
        Try
            With _ADO
                _ADO.SQLStr = "usp_GetStandByTimeByEmp '" & Inserv & "', '" & Outserv & "', '" & Employee & "'"
                _DataSet = .ReturnDataSet
                dg_WO.DataSource = _DataSet.Tables(0)
                dg_WO.DataBind()
            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...