fb

Ads

Pages

Accessing a Database from a Windows Application [VB.net]

VB.NET includes a number of new controls for accessing data from your application.You can see this in action by creating a new Windows Application project in VB.NETand naming it LearningVBdata. Click on the Toolbox and notice that there is a Data tab at the top. Click on the Data tab, and you will see a series of controls as shown in here. 



In the past, controls dragged from the Toolbox and dropped on the form
were shown on the form. In VB.NET, however, controls that do not have a visual interface appear in the component tray, a window below the form. This is where the majority of your data controls will appear when added to a form.


There is a second option for data access that helps separate things and keeps them a little cleaner. You can use components, or forms without a visual part; these are classes with a designer. All your forms can share these components. Thus, you can have a single component that’s responsible for all the data access in your project and your forms can connect to it. This is the model you will follow in the next few pages. Select Add New Item from the Project menu and double-click the Component Class icon. This will add a new component, named Component1, to your project.

0 comments:

Post a Comment