CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2013
    Posts
    1

    Problem with DataGridView

    I have an application in VB 2005 and try to replace old AxMSHierarchicalFlexGridLib.AxMSHFlexGrid
    with a DataGridView

    Before I used a connection to a database like this:

    cn = New ADODB.Connection
    rs = New ADODB.Recordset

    cn.Open(ODBC_cn, USR, PSSWD)
    cn.CursorLocation = ADODB.CursorLocationEnum.adUseNone
    rs.Open(strSql, cn, , ADODB.LockTypeEnum.adLockOptimistic, ADODB.CommandTypeEnum.adCmdText)

    then I simply used

    Public WithEvents hiflegriSeek As AxMSHierarchicalFlexGridLib.AxMSHFlexGrid
    hiflegriSeek.DataSource = rs

    ...but I can´t do that when I declare hiflegriSeek as DataGridView
    when I use hiflegriSeek.DataSource = rs
    the result is just nothing

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Problem with DataGridView

    I'd suggest trying to add the database connection in design view. The reason why I say this is so that you can possibly detect if your datasource is indeed valid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured