Use VB.NET to combine with Acess to achieve a simple phone number (1)

zhaozj2021-02-11  195

All source code downloads:

http://www.up2e.com/resource.php

Use VB.NET and Acess to achieve a simple phone number book (1) - by zigz (Luhai) Luluhai@eastday.com first look at the interface:

1) Application of control OLEDBCONNECTION control, OLEDBCOMMAND control, ListView control, ERRORPROVIDER control 2) Step 1) New project and add basic controls 2) Add and set Label, TextBox, button control 3) Add OLEDBCONNECTION, OLEDBCOMMAND control 4) Write each corresponding Program Code 3) Program features can be recorded, delete, and list all records. Figure 4 After the phone number This master interface enters information in the text box above, click the Add button to complete a record. Click the Delete button, the interface of Figure 5 will appear. Figure 5 Deleting a record interface In the text box, enter the name of the name to delete. Click the Delete button, complete the operation of the delete record, and delete success will have a prompt.

Click the "List List" button in the main interface to list a list of all records (see Figure 6), here I use the ListView control to display all records. His related principle is to display all records of the database through OLEDBDataReader combined with a ListView control.

Example: Dim Reader As Oledb.oledBDataReader

..........

........

Reader = mainform.oledbcommand1.executeReader 'Returns all records

Do While Reader.Read 'lists all records with listview

DIM Li as new listviewItem ()

li.subitems.clear ()

li.subitems (0) .Text = Reader ("Name").

............... Figure 6 list shows unreasonable ...

转载请注明原文地址:https://www.9cbs.com/read-3751.html

New Post(0)