papa_k Posted June 12, 2003 Posted June 12, 2003 I have a exe that i have created that collects stuff from a SQL server and puts it on the screen, VB database basically. I have written it in VB6, and i converted it to VB.net The code that worked fine on the 6 version now does not work on .net. I knew that this might be the case... My problem... I have a data grid on a form that i can directly reference in VB6, and i do, with the data being dumped from my record set 'rstUser' to a form 'frmRefData' with a data grid on it called 'dtgUser'. The working VB 6 code: frmRefData.dtgUser.DataSource = rstUser this is only one line taken, but the record set and all is working fine...the problem arrises thus... The NON WORKING VB.net code: (the 'comments were put there by the VB.net upgrade wizard) 'UPGRADE_ISSUE: VBControlExtender property dtgUser.DataSource is not supported at runtime frmRefData.dtgUser.DataSource = rstUser and i get the error "Reference to a non-shared memeber requires and object reference" in the task list in .net what do i do to get this working again? i am really stumped with this...leave a note if you need more information and i shall supply it (if i can) Cheers, Papa Quote without time nothing ever ends
*Gurus* divil Posted June 12, 2003 *Gurus* Posted June 12, 2003 frmRefData is the name of the class, not a handle to an instance of it. Forms are the same as other classes, you need an instance of them before you can mess with their properties. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
papa_k Posted June 12, 2003 Author Posted June 12, 2003 would simply changing the code to dtgUser.DataSource = rstUser work do you think? Quote without time nothing ever ends
*Gurus* divil Posted June 12, 2003 *Gurus* Posted June 12, 2003 If this code is in the form itself, yeah. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.