Results 1 to 2 of 2

Thread: [RESOLVED] DataGridView upgrade

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    13

    Resolved [RESOLVED] DataGridView upgrade

    Hello,

    I have an old VB6 project converted into VB2008 express. It contains a datagrid control called AxMSDataGridLib.AxDataGrid. This is probably legacy control from previous VB versions, am I right?

    The application reads data to this grid using ADO and it works most of the time. It is supposed to be read only but I cannot parametrize it correctly and sometimes when I exit the application I get an exception. Now, I seriously lack skills of this IDE and .net framework since I don't know how to get more info about the exception. The exception is just a messagebox saying something like "Key column invalid or not sufficient. Update changed too many columns". This exception comes from this datagrid.

    Now, since there's a high probability that this is an old control and I cannot get the exception handled, I was thinking to upgrade it to .net DataGridView.

    Does anyone know if upgrading this old AxDataGrid to .net DataGridView is possible and how to do it?

    I am abit afraid to just delete the old control and replace it with new since the application works and I am not attached to any source control (for reverting changes). Maybe it's possible to make a copy of this project with another name and safely play with it?

    Thanks for your time!

    Cheers!

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    13

    Re: DataGridView upgrade

    Answering just if someone else is interested about this...

    1) I was able to copy the project and safely play with it in another location as suspected. So sandboxing project like this is possible, maybe there is a "preferred" way but this works too...

    2) Replacement is possible from AxDataGrid to DataGridView. I didn't find any automation tools for this. It requires some work, but nothing special tbh. For me it took like 1 hour to get some data to a new DataGridView. There are several good resources in the net, just google with DataGridView. This forum also has alot of threads concerning the topic.

    My legacy application uses ADO and ADO.Recordset to populate AxDataGrid which can be pain in the ... when upgrading to DataGridView since it doesn't work with ADO.Recordset. Somewhere I read that DataGridView needs to be able get the properties of the row(s) from the source which isn't supported by ADO.Recordset.

    Nevertheless, SqlDataAdapter and OleDbDataAdapter does the trick... latter for me since I use access database.

    Happy coding!

Tags for this Thread

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