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