SunQuest
 
       Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - Displaying an Oracle 10G XE Table with Vis...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Displaying an Oracle 10G XE Table with Visual Basic 6.0
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2006-08-22

    Table of Contents:
  • Displaying an Oracle 10G XE Table with Visual Basic 6.0
  • Create a Visual Basic Standard EXE Project
  • Configure the ADODC Data Control
  • Connect the ADO Data Control to the table to be displayed

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Displaying an Oracle 10G XE Table with Visual Basic 6.0 - Connect the ADO Data Control to the table to be displayed


    (Page 4 of 4 )

    Click on the authentication tab. It should come up with the one you configured earlier. In case it does not come up with the credentials, you must use the User Name/Password to proceed to the next tab. Click on the tab RecordSource.

    It comes up with the default, adCmdUnkown. Since we will be displaying the contents of a table, choose adCmdTable from this drop-down list. Click on the OK button.

    This should now reveal the Table or Stored Procedure Name combo box. When you click on the drop-down, you should see all the tables in Oracle 10G XE's HR database as shown. Click on the table Employees to choose it and then click OK.

    Displaying the table using data bound controls

    In this section the ADODC Data Control will serve as the source of data for the data bound controls, and we will see how it is done. You may use any of the data bound controls such as Textbox, Listbox, or Combobox and bind them to data using this control. In this tutorial, to keep it simple, only the Textbox control will be used. Place four textboxes and four labels as shown on the form. Each of these text boxes will be bound to a column in the Employees table. For example, the next couple of pictures show how you may bind the Employee_ID column on Oracle to Textbox1. Although labels in VB6 can also be bound to data, resist doing so for this tutorial.

    Right click Textbox1 to bring up its Properties window as shown. You may click on the Categorized tab so that you can concentrate on data-related items. When you click on the empty space alongside the DataSource you should be able to pick up Adodc1. You could have a number of ADO Data controls on a form and all of them will show up in the drop-down list. Next, click on an empty area alongside the DataField item (shown in red, "click here"). In the empty area you will see a drop-down list from which you now choose Employee_ID. By this choice you have bound Textbox1 to the EmployeeID Column. Even at this point you may run the project and see only the Employee_ID.

    Similarly configure the other textboxes. In this tutorial the third textbox has been bound to the telephone number field in Oracle 10G XE. You may also format this to show the telephone number. For this you need to click on an empty area of the DataFormat item in the bound controls Properties window. This brings up this next window where you may supply formatting to be displayed. An example for the column Telephone is shown. This custom formatting does not seem to be working, as the format string does not conform with the one configured. The way it is showing up is exactly the same as you would see in the Oracle database table.

    Now you may run the project to display some of the columns in Oracle 10G XE's Employee table in the HR database. You may click on the navigational keys to move to the first, last, next and previous positions.

    Summary

    Connecting to an Oracle 10G XE database table using Microsoft's ADODC control was described in this tutorial. Once you get past the successful testing of the ODBC connection the rest of it is very easy. Although an example of binding to the textbox is shown, it is relatively easy to connect to other databound standard controls as well as the DataList (Microsoft DataList Control 6.0, MSDATALIST.ocx) and DataGrid (Microsoft DataGrid Control 6.0, MSDATAGRID.ocx) controls. In this case you may have to add these ActiveX controls to your toolbox.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · You are used to VB and you don't care about (.NET) for any number of reasons and...
     

    VISUAL BASIC.NET ARTICLES

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway