Database
  Home arrow Database arrow Page 5 - Creating Database Projects with SQL Anywhe...
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 
Mobile Linux 
App Generation ROI 
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? 
DATABASE

Creating Database Projects with SQL Anywhere Studio, Part 2
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2005-02-21

    Table of Contents:
  • Creating Database Projects with SQL Anywhere Studio, Part 2
  • Integrated Login
  • Importing ASA data into an Excel worksheet
  • Creating a VB application
  • An example of ADO.NET application

  • 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


    Creating Database Projects with SQL Anywhere Studio, Part 2 - An example of ADO.NET application


    (Page 5 of 5 )

    Again a rapid application path will be chosen to demonstrate working with Adapter Server Anywhere. The first thing is to start the Database server as discussed previously. Next start an ASP.NET Web application by adding a Web form (default WebForm1.aspx). If you do not see the data controls that were automatically added when iAnywhere software was installed as shown in the next picture,

    Creating Database Projects with SQL Anywhere Studio, Part 2

    you must then right click on the Data tab in the Toolbox and select Add/remove items from the pop-up menu. This will open a dialogue where you can add these items as shown here.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Now drag the AsaConnection object to the WebForm1's design plane. This will add an AsaConnection1 control to the tray below the design plane as shown. Also observe the automatic entries in the properties window.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Now drag an AsaCommand control from the Toolbox to the design plane of WebForm1. aspx. This will add an instance AsaCommand1 of asaCommand object.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    In the above dialog, right click on the CommandText, which opens the following Command Text builder tool. You can enter the SQL Statement here as shown. You may execute the statement and see the results. Click OK to this, and the command will execute when called against the database using this statement

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Now add a command button which has the following text in this example, "Get Customers from MN." Add also a DataGrid from Toolbox to the design plane to display the results. To the click event of this button, add the following code.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.
    EventArgs) Handles Button1.Click
    AsaConnection1.Open()
    'give full reference to object
    Dim dr As iAnywhere.Data.AsaClient.AsaDataReader
    dr = AsaCommand1.ExecuteReader
    DataGrid1.DataSource = dr
    DataGrid1.DataBind()
    End Sub

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Build the project, right click webForm1.aspx, and select View in Browser. If everything is working as it should, the following output may be seen in the browser.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Summary

    Easy to use Adaptive Server Anywhere adapts itself (no pun intended) extremly well, and integrates well with Microsoft products Excel, VB 6.0, and VB.Net. The server software supports the creation of database objects by providing the necessary hooks in terms of design time controls, once the proper reference is established. Although extremely simple cases of database projects were considered, it should be relatively easy to create projects which manipulate data on the server.


    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.

     

    DATABASE ARTICLES

    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT