O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading the Data and Schema

Before the control does anything, it has to be able to read the schema from the database based on the Select statement. Let’s create a public subprocedure and call it ReadData. We want the procedure to behave a little differently when the control is displayed in a form designer than when it is running in an application. When the control is in a designer, we don’t want to read data from the database. What we really want to do is to read the schema. The DataAdapter has a method just for this purpose called FillSchema. The question is, how do we detect if the control is in a designer or in design mode?

If you never developed controls in VB 6, you might be wondering what the heck I’m talking about. This can get a little ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required