row is not a member of

I am currently working on Migration of VB6 app to VB.Net, I had error in following line.
For iCounter = 1 To frmProfiles.DefInstance.Controls(sControlName).Row - 1 Step 1
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
What are you trying to do exactly?

It looks as if you want to loop through the rows in a DataGridView or some similar control, but if this is so, a few things are not right.

Can't you directly use the control by its name, something like DataGridView1.Row? Usually, you use Controls when you cannot do that for some reason, but what you can do then is limited.

I do not know of any control where you use Row alone. It is usually either Rows or Row(number). And if you want to loop through the rows as I suspect, it would be Rows.Count.

Tell us what you are trying to do, and we should be able to help.

This being said, seeing that DefInstance, I suspect that you have converted you VB6 application directly to .NET. This is garbage. Unless you have a very simple application, you will spend a great deal of time trying to make it work and will succeed only if you are lucky. And you will not learn VB.NET. Nobody uses DefInstance in "real" code. Only the converter uses it, to try to make your application works as it did in VB6. VB.NET is very different.

You are usually better to rewrite your application. Believe me, it looks as if it will take longer, but it won't. Most people who use the converter end up losing time going round and round before the drop everything and restart from scratch.

Finally, when you ask a question about VB.NET, do not put VB Script in the topics. VB Script has absolutely nothing to do with VB.NET. They both have VB in their name, but it is like saying that you want to play your VHS tape in your new Blu-Ray player because they both have movies on them.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.