database to msflexgrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cutecatcher
    New Member
    • May 2007
    • 6

    #1

    database to msflexgrid

    i have a problem regarding on how to transfer datas from msflexgrid. When i was using datagridview, i just use "Datagridview1. datasource=ds.T ables[0].defaultview;" but it seems, it doesn't work at flexgrid at all. So if anyone could just help me on how can i display data on a msflexgrid, it will surely be a great help..

    thanks!
  • brazel
    New Member
    • May 2007
    • 11

    #2
    Good day!

    Hello,

    I want to give some Idea if I can help you this following code.

    Dim db As Database
    Dim rs As Recordset

    Private Sub Form_Load()

    MSFlexGrid1.Cle ar
    MSFlexGrid1.Row s = 2
    MSFlexGrid1.Col s = 7

    Set db = DBEngine.OpenDa tabase(App.Path & "\sample.md b")
    Set rs = db.OpenRecordse t("table1")
    On Error Resume Next ' to ignore the error
    rs.MoveFirst ' this line can be error if no records in the table

    Do Until rs.EOF
    MSFlexGrid1.Row = MSFlexGrid1.Row s - 1

    Griddisply

    MSFlexGrid1.Row s = MSFlexGrid1.Row s + 1
    rs.MoveNext
    Loop

    End Sub

    Sub Griddisply()
    Dim a As Integer
    For a = 0 To 7
    MSFlexGrid1.Col = a
    MSFlexGrid1 = rs(a)
    Next a
    End Sub

    Comment

    • cutecatcher
      New Member
      • May 2007
      • 6

      #3
      Good pm!

      i forgot to say that i am using a C# programming language, Can you give me a code in C# that also transfer data from a database to flexgrid?

      tnx!




      Originally posted by brazel
      Good day!

      Hello,

      I want to give some Idea if I can help you this following code.

      Dim db As Database
      Dim rs As Recordset

      Private Sub Form_Load()

      MSFlexGrid1.Cle ar
      MSFlexGrid1.Row s = 2
      MSFlexGrid1.Col s = 7

      Set db = DBEngine.OpenDa tabase(App.Path & "\sample.md b")
      Set rs = db.OpenRecordse t("table1")
      On Error Resume Next ' to ignore the error
      rs.MoveFirst ' this line can be error if no records in the table

      Do Until rs.EOF
      MSFlexGrid1.Row = MSFlexGrid1.Row s - 1

      Griddisply

      MSFlexGrid1.Row s = MSFlexGrid1.Row s + 1
      rs.MoveNext
      Loop

      End Sub

      Sub Griddisply()
      Dim a As Integer
      For a = 0 To 7
      MSFlexGrid1.Col = a
      MSFlexGrid1 = rs(a)
      Next a
      End Sub

      Comment

      • brazel
        New Member
        • May 2007
        • 11

        #4
        Hello,

        Sorry I'm not so familiar in C#, I looked at Microsoft Visual C# 2005 Express Edition, I can't see if they have a flixgrid, only Datagridview.

        Comment

        • cutecatcher
          New Member
          • May 2007
          • 6

          #5
          i just added that component in C#.. wooh! this was really tough! i cannot find anything in the net.. well, thanks anyway! Godbless

          Comment

          Working...