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
            '=============================================================
           <FONT color=#ff0000> 'DGList is ystem.Windows.Forms.DataGrid</FONT>
            dsList.Tables(0).TableName = "resultList"
            DGList.SetDataBinding(dsList, "resultList")<FONT color=#ff0000> 'data Binding OK
    </FONT>        DGList.RowHeadersVisible = False
            DGList.CaptionVisible = False
            '=============================================================
            '=============================================
            <FONT color=#ff0000>'ASList is AxFPUSpreadADO.AxfpSpread</FONT>


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


            ASList.DataMember = "resultList"
            ASList.DataSource = dsList.Tables("resultList")<FONT color=#ff0000>'data binding error</FONT>


    <FONT color=#ff0000>the error  is  "Option Strict On disallows implicit conversions from 'System.Data.DataTable' to 'msdatasrc.DataSource'."</FONT>


            '=============================================
               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