我如何在vb.net中使用mshflexgrid? [英] How can I mshflexgrid in vb.net?

查看:85
本文介绍了我如何在vb.net中使用mshflexgrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何使用adodb在datagridview中显示记录?

我用过mshflexgrid&它运作良好,但是当我尝试构建程序时,它显示错误,提示未定义AxMSHierarchicalFlexGridLib.AxMSHFlexGrid" .

我将分享我为mshflexgrid编写的代码以显示记录的代码.请检查&告诉我应该怎么做,或者通过使用adodb来写以显示datagridview中的记录,或者如果我使用mshflexgrid,那么在构建程序时如何摆脱该错误.
我的代码:

I need to know how can I show records in datagridview by using adodb?

I have used mshflexgrid & it workded well but when I try to build my program it shows error that "AxMSHierarchicalFlexGridLib.AxMSHFlexGrid'' is not defined".

I am going to share my code what I have written for mshflexgrid to show record. Please check it & tell me what should I do or write to show record in datagridview by using adodb or if I use mshflexgrid how can I get rid of that error when I will build my program.
My code:

Private Sub Form34_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

con = New ADODB.Connection

con.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SUIMT")

End Sub

Private Sub cmbdmidt_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbdmidt.Leave
    On Error Resume Next
    rst = New ADODB.Recordset
    With rst
        .Open("Select row_num, stu_id, tot_amou, paid, du, aoins, due, dt From monthly_instal where stu_id = '" & cmbdmiidn.Text & "' AND dt = '" & cmbdmidt.Text & "'", con, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
        
        Mshgrid2.DataSource = rst

        Mshgrid2.set_TextMatrix(0, 0, "ROW NUMBER")

        Mshgrid2.set_TextMatrix(0, 1, "ID NUMBER")

        Mshgrid2.set_TextMatrix(0, 2, "TOTAL AMOUNT")

        Mshgrid2.set_TextMatrix(0, 3, "PAID")

        Mshgrid2.set_TextMatrix(0, 4, "DUE")

        Mshgrid2.set_TextMatrix(0, 5, "AMOUNT OF INSTALLMENT")

        Mshgrid2.set_TextMatrix(0, 6, "DUE")

        Mshgrid2.set_TextMatrix(0, 7, "DATE")

        Mshgrid2.set_ColWidth(0, 2500)
        Mshgrid2.set_ColWidth(1, 2500)
        Mshgrid2.set_ColWidth(2, 2500)
        Mshgrid2.set_ColWidth(3, 2500)
        Mshgrid2.set_ColWidth(4, 2500)
        Mshgrid2.set_ColWidth(5, 2500)
        Mshgrid2.set_ColWidth(6, 2500)
        Mshgrid2.set_ColWidth(7, 2500)
        .Close()
    End With
End Sub

推荐答案

我想您会丢失对AxMSHierarchicalFlexGridLib的引用.而且我认为打开表单时会发生错误.在con = New Adodb.Connection处放置一个断点,看看它是否碰到了那个断点.

我猜想您已经将dll移到了拥有mshFlexGrid的位置,或者在没有该dll的另一台计算机上打开了您的项目.
I would guess that you''ve lost the reference to AxMSHierarchicalFlexGridLib. And I assume that the error happens when your form opens. Put a breakpoint at con = New Adodb.Connection and see if it even hits that breakpoint.

I would guess you''ve moved the dll where you got the mshFlexGrid, or opened your project on a different computer that doesn''t have that dll.


这篇关于我如何在vb.net中使用mshflexgrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆