Data Transfer Problem

I'm happy you can be helpful to me, I wrote the following codes.
How can I fix the error Object reference not set to an instance of an object.
    Private Sub PrntPvw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrntPvw.Click

        ConNPos()

        OLEAdp2 = New OleDbDataAdapter(SqlLst, OLEConN)
        FrxDtSet = New DataSet With {.DataSetName = "MACIPAdress"}

        OLEAdp2.Fill(FrxDtSet)

        FReport = New Report

        FReport.Load(RprtName)

        FReport.RegisterData(FrxDtSet)

        MstrDt = New FastReport.DataBand
        TxtObj = New FastReport.TextObject

        MstrDt = FReport.FindObject("DataTbl")
        TxtObj = FReport.FindObject("Sample")

        MstrDt.DataSource = FReport.GetDataSource("MACIPAdress")

        For i As Integer = 0 To FrxDtSet.Tables(0).Rows.Count - 1

            TxtObj.Text = FrxDtSet.Tables(0).Rows(0).Item(0)

        Next

        FReport.Show()
        FReport.Dispose()

        DisConnect()

    End Sub

Comments

  • edited 2:30PM
    The list is wrong
    53622008.png

    the correct form of a list
    65641690.png

    codes are as follows:
        Private Sub PrntPvw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrntPvw.Click
    
            ConNPos()
    
            OLEAdp2 = New OleDbDataAdapter(SqlLst, OLEConN)
            FrxDtSet = New DataSet With {.DataSetName = "MACIPAdress"}
    
            OLEAdp2.Fill(FrxDtSet)
    
            FReport = New Report
    
            FReport.Load(RprtName)
    
            FReport.RegisterData(FrxDtSet)
    
            AdSydObj = FReport.FindObject("AdSydTxt")
            GrvObj = FReport.FindObject("GrvTxt")
            BrmObj = FReport.FindObject("BrmTxt")
            MAC1Obj = FReport.FindObject("MAC1Txt")
            Net1Obj = FReport.FindObject("Net1Txt")
            MAC2Obj = FReport.FindObject("MAC2Txt")
            Net2Obj = FReport.FindObject("Net2Txt")
            IPNoObj = FReport.FindObject("IPNoTxt")
    
    
    
            For i As Integer = 0 To FrxDtSet.Tables(0).Rows.Count - 1
    
                AdSydObj.Text = FrxDtSet.Tables(0).Rows(i).Item(0).ToString
                GrvObj.Text = FrxDtSet.Tables(0).Rows(i).Item(1).ToString
                BrmObj.Text = FrxDtSet.Tables(0).Rows(i).Item(2).ToString
                MAC1Obj.Text = FrxDtSet.Tables(0).Rows(i).Item(3).ToString
                Net1Obj.Text = FrxDtSet.Tables(0).Rows(i).Item(4).ToString
                MAC2Obj.Text = FrxDtSet.Tables(0).Rows(i).Item(5).ToString
                Net2Obj.Text = FrxDtSet.Tables(0).Rows(i).Item(6).ToString
                IPNoObj.Text = FrxDtSet.Tables(0).Rows(i).Item(7).ToString
    
                'ListBox1.Items.Add(FrxDtSet.Tables(0).Rows(i).Item(0))
    
            Next
    
            FReport.Show()
            FReport.Dispose()
    
            DisConnect()
    
        End Sub
    

    Please help

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.