Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Migration issue from VB6 to VB.Net

Migration issue from VB6 to VB.Net

Scheduled Pinned Locked Moved Visual Basic
helpcsharp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sree Nivas
    wrote on last edited by
    #1

    Hi 1. I migrated vb6 project to vb.net project. 2. The msdatagrid in vb6 is migrated to vb.net axdatagrid 3. while i tried to bind data to that axgrid like ReferenceGrid.DataSource = ds.Tables(0) it shows error as cannot cast ..... 4. Then i used this code to caste it ReferenceGrid.DataSource = CType(ds.Tables(0), msdatasrc.DataSource) 5. still i cannot bind datasource to axgrid getting error as: Unable to cast object of type 'System.Data.DataTable' to type 'msdatasrc.DataSource' 6. Can any one give me code to bind data to converted axdatagrid. -------------------------------------------------------------------------------- chandra shekar thota

    D 1 Reply Last reply
    0
    • S Sree Nivas

      Hi 1. I migrated vb6 project to vb.net project. 2. The msdatagrid in vb6 is migrated to vb.net axdatagrid 3. while i tried to bind data to that axgrid like ReferenceGrid.DataSource = ds.Tables(0) it shows error as cannot cast ..... 4. Then i used this code to caste it ReferenceGrid.DataSource = CType(ds.Tables(0), msdatasrc.DataSource) 5. still i cannot bind datasource to axgrid getting error as: Unable to cast object of type 'System.Data.DataTable' to type 'msdatasrc.DataSource' 6. Can any one give me code to bind data to converted axdatagrid. -------------------------------------------------------------------------------- chandra shekar thota

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You cannot bind a .NET type to the old FlexGrid. Replace the old grid with the DataGridView in the Toolbox and then you can bind that to your .NET DataSet or DataTable object. Of course, if there's other code that manipulates the old grid, you'll have to replace that code with something that does what you need in the DGV.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You cannot bind a .NET type to the old FlexGrid. Replace the old grid with the DataGridView in the Toolbox and then you can bind that to your .NET DataSet or DataTable object. Of course, if there's other code that manipulates the old grid, you'll have to replace that code with something that does what you need in the DGV.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        S Offline
        S Offline
        Sree Nivas
        wrote on last edited by
        #3

        Hi Dave, Excellent Answer. I tried to use new grid and confused whether to use Datagrid or DataGridView. I also found all event which are there in VB6 Grid are not there in VB.Net Grids.Please suggest me some thing to implement this. I am looking for add button control in vb.net grid also. Suggest me.

        modified on Saturday, December 27, 2008 2:57 AM

        D 1 Reply Last reply
        0
        • S Sree Nivas

          Hi Dave, Excellent Answer. I tried to use new grid and confused whether to use Datagrid or DataGridView. I also found all event which are there in VB6 Grid are not there in VB.Net Grids.Please suggest me some thing to implement this. I am looking for add button control in vb.net grid also. Suggest me.

          modified on Saturday, December 27, 2008 2:57 AM

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          There is no button in the grid. Normally, you would supply this button seperately and supply an appropriate input form or control to create a new record in the DataSet/DataTable you have the grid bound to.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups