Data Binding's error use datasource

Posted by: duanmeng on 8 September 2017, 12:27 pm EST

  • Posted 8 September 2017, 12:27 pm EST

    Private Function ShowList(ByVal dsList As DataSet) As Boolean
            '=============================================================
            'DGList is ystem.Windows.Forms.DataGrid
            dsList.Tables(0).TableName = "resultList"
            DGList.SetDataBinding(dsList, "resultList") 'data Binding OK
            DGList.RowHeadersVisible = False
            DGList.CaptionVisible = False
            '=============================================================
            '=============================================
            'ASList is AxFPUSpreadADO.AxfpSpread


             Dim dataT As DataTable
            dataT = dsList.Tables(0)
            Dim dtv As DataView = New DataView(dataT)


            ASList.DataMember = "resultList"
            ASList.DataSource = dsList.Tables("resultList")'data binding error


    the error  is  "Option Strict On disallows implicit conversions from 'System.Data.DataTable' to 'msdatasrc.DataSource'."


            '=============================================
               End Function


     


    I am a chinese user ,my english is not very good , thank you

  • Replied 8 September 2017, 12:27 pm EST

    duanmeng -

    This is not going to work.  You are trying to bind an ActiveX control to a .Net datatable.  The ActiveX control doesn't know anything about .Net databinding.  I would suggest adding the ADO DataControl ActiveX control to your project and use that.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels