0% found this document useful (0 votes)
30 views13 pages

CCP603

This document discusses database programming using Visual Basic. It covers displaying data through bound controls like list boxes. A list box displays items from a database and allows selection. The data source and data field properties specify the data connection. Methods like AddItem and RemoveItem control the list contents. An example demonstrates binding a list box to a table to display records.

Uploaded by

api-3849444
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views13 pages

CCP603

This document discusses database programming using Visual Basic. It covers displaying data through bound controls like list boxes. A list box displays items from a database and allows selection. The data source and data field properties specify the data connection. Methods like AddItem and RemoveItem control the list contents. An example demonstrates binding a list box to a table to display records.

Uploaded by

api-3849444
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : Y. Vijaya Bhaskara Reddy
Designation : Senior Lecturer
Branch : Commercial and Computer Practice
Institute : G.P.W., Kakinada.
Year/Semester : VI Semester.
Subject : Visual Basic – II
Subject Code : CCP-603.
Topic : Database Programming
Duration : 50 minutes.
Sub Topic : Data bound Controls
Teaching Aids : PPTs.

CCP603.33
OBJECTIVES

On completion of this period, you would


be able to:

1. Know about Data bound controls.

CCP603.33
STRUCTURE

 Displaying data through a bound control

 Example – ListBox control

CCP603.33
RECAP

 Displaying data through a bound control

 Example – Text box control

CCP603.33
DATABASE PROGRAMMING
Displaying data through a bound control:
 Bound controls provide access to specific data in your
database
 Bound controls that manage a single field typically display the
value of a specific field in the current record
 The DataSource property of a bound control specifies a valid
data source, and the DataField property specifies a valid field
name in the Recordset object created by the data source
 Together, these properties specify what data appears in the
bound control

CCP603.33
DATABASE PROGRAMMING
Example – ListBox Control:

 A ListBox control displays a list of items from


which the user can select one or more
 If the number of items exceeds the number that
can be displayed, a scroll bar is automatically
added to the ListBox control

CCP603.33
Database programming
Example – listbox control (contd….):
 The first item in the list is ListIndex 0, and the value of the
ListCount property is always one more than the largest
ListIndex value
 To add or delete items in a ListBox control, use the
AddItem or RemoveItem method
 A ListBox control that is bound to a Data control doesn't
support the AddItem method

CCP603.33
Database programming
Example – listbox control (contd….):

 Set the List, ListCount, and ListIndex


properties to enable a user to access items in the
ListBox
 Alternatively, you can add items to the list by
using the List property at design time
 ListBox can only be filled with values from a
database through a program with its Additem
method

CCP603.33
QUIZ:

1.What are the methods to add or remove


items from a list box ?

1. AddItem
2. RemoveItem

CCP603.33
FREQUENTLY ASKED QUESTIONS

1. Briefly explain the usage of ListBox control.

CCP603.33
SUMMARY
 Displaying data through bound controls
 ListBox control

CCP603.33
ASSIGNMENT

1. Create a new form in Visual Basic.

2. Connect a table using a data control.

3. Display the data through list box.

CCP603.33
THANK YOU

CCP603.33

You might also like