SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
Sybase ASE 15
with ASP.NET 2.0
By Anil Mahadev




Anil Mahadev provides the ISUG                 ybase continues to make significant     Software requirements
Technical Journal with a
‘QuickStart’ tutorial on web
                                       S       enhancements to its flagship enter-
                                               prise class database Adaptive Server
                                       Enterprise (ASE). The release of version
                                                                                       1) Windows 2000 and above.
                                                                                       2) A personal copy of SYBASE ASE 15
                                                                                           (Any edition will do, as we are devel-
application development with           15 in 2005 along with its subsequent sib-           oping for test purposes only, I will be
Sybase ASE 15 and ASP.NET 2.0          lings, 15.0.1 and 15.0.2, in later years has        using the Developer Edition of
                                       awoken the curiosity of more and more               SYBASE ASE 15 for Windows.)
                                       developers who are now taking ASE for a                You can download SYBASE ASE 15
                                       spin. Couple this with Sybase's commit-             from the Sybase website and try it out.
                                       ment to supporting additional develop-              It’s FREE for development purposes
                                       ment platforms, like .NET and J2EE in               only (not to be deployed in a produc-
                                       addition to Power Builder - and you can             tion environment) as specified by the
                                       see why this is an exciting time for us             license agreement. www.sybase.com/
                                       developers.                                         ase_1500devel
                                                                                       3) Microsoft Visual Studio.NET 2005
                                         What has changed?                                 (Professional or Team System) - you
                                         Sybase ASE and .NET have now become               can order a free Trial DVD from
                                         so much easier to use than the previous           Microsoft.
                                         releases – and Visual Studio 2005 promises    4) Install the SYBASE ASE 15 Data
                                         a whole lot of features that Sybase has           Provider for ADO.NET during the
                                         taken advantage of in its Data Window             installation of SYBASE ASE 15.
                                         .NET software. In this piece,                        We shall be using the pubs2 sample
                                             I am happy to share with you my               database and authors table. For those
                                         experience of using SYBASE ASE 15                 of you who do not have the pubs2
                                         with ASP.NET 2.0 within the Visual                database installed. Follow these steps
                                         Studio 2005 IDE – and I’m going to do             to install them on your ASE Server.
                                         so without writing a single line of code.         a) Open Interactive SQL and from
                                             In VS 2005 and ASP.NET 2.0, using                  the File Menu choose Run Script.
                                         ASE 15 has never been as good as it is            b) Navigate to your Sybase ASE
                                         now. In this first segment, I will take you            installation folder and drill down
                                         through building a data-driven website                 to the scripts folder.
                                         using Sybase ASE 15’s ADO.NET Data                c) Under that, filter by all files and
                                         Provider with ASP.NET 2.0. The goal of                 choose pubs2.
                                         the application is that it must display the       d) Now the database starts getting
Anil Mahadev is an experienced data- authors from the authors table, it must                    created for you – and you can view
base consultant and writer on database also perform sorting and pagination.                     it from within Sybase Central.
technologies with several years training     We are going to be using the Grid         Now that we have our database and tables
& consulting experience. He is           View Control for this – so here are the       ready, we can visually build applications in
available at anilm001@gmail.com          requirements for this tutorial.               Visual Studio 2005.

30    ISUG TECHNICAL JOURNAL
SYBASE ASE 15         WITH    A S P. N E T   2.0




Steps to building the application                             You can download SYBASE ASE 15 from the
Launch Visual Studio 2005. Click on File ➠ New Website.
Now you can choose the language and select from C# or VB      Sybase website and try it out. It’s FREE for
as shown in figure 1.
                                                              development purposes only and not to be

                                                              deployed in a production environment as

                                                              specified by the license agreement.




                                                                                                                                DESIGN & DEVELOPMENT
Figure 1

We now will be in the source view by default – so switch to
the Design View.
    Then you can add the following controls onto the page
and set their properties as indicated in the table below.
Control Name               Properties

Label Control              Building ASP.NET Apps with
                                                              Figure 2
                           Sybase ASE 15

GridView Control           None needed - only                 Our application should now look like figure 3.
                           configuration required.


We now have our controls in place so we need to perform one
more step before proceeding. We need to add a reference to
the ASE Data Provider Namespace Assembly.
a) Right click on the Project and choose Add reference.
    Now under the tabs, choose under the .NET tab you can
    see the Sybase.Data.AseClient or alternatively you can
    navigate to the Sybase ASE Installation folder
    x:SYBASEASE15DataAccessADONETdll
    where x is your drive in your own hard drive.
                                                              Figure 3
Next choose the Sybase.Data.AseClient.dll. Then click on
OK and your project now hosts the ASE for .NET Assembly       Configuring our Data Source
as shown below. The Sybase ASE .NET Client is registered as   We are now going to create a new connection to the ASE
a Native Assembly within the Windows operating system.        Server. Click on your Grid View Control and under Data
    This is shown in figure 2.                                Source choose New Data Source.




                                                                                                M AY- J U N E 2 0 0 8     31
SYBASE ASE 15           WITH    A S P. N E T   2.0




    Under Data Sources➠Data Source Configuration Wizard
choose create a new Connection. Now we will need to build a
new Sybase Data Source. Under the System DSN Tab, click
new and choose Adaptive Server Enterprise as the chosen
database server. Now you will be taken to a dialog where you
will need to specify an existing connection to a Sybase ASE
15 database.
    The connection dialog will be as shown in the figure 4.


                                                                      Figure 6

                                                                      Configuring the grid view
                                                                      You will need to choose the connection you have created to
                                                                      connect to Sybase ASE 15.
                                                                          Click next and give this ConnectionString a name, say,
                                                                      pubs2 - and then you have the option to re-use this connection
                                                                      string for multiple pages. Click ‘next’ as shown in figure 7.




Figure 4

Next you will need to test the connection. Once you get a             Figure 7
message that says Login Succeeded, it means that the connec-
tion to your server is now ready.                                     You will be asked to select a table from Sybase ASE 15. Since
    [Note: As a security measure ASE does not allow the user to       only the views are displayed, choose the ‘Specify a custom
enter the password directly. Instead the user is given an option to   SQL statement’ option and manually enter the SQL
enter the password in the next dialog once the user clicks on Test    Statement by clicking next as shown in figure 8.
Connection.]
    You will now get a message (as shown in figure 5) for
successful connection.

Figure 5

Reasons for connections not succeeding
1) Check your Server status ➠ Running.
2) Check the port numbers on your machines.
3) Verify the credentials.
   The Data Source name will be the connection parameter              Figure 8
that the GridView will take when connecting to your Sybase
ASE Database Server and displaying the contents onto your              We will now get a list of all the author details from the
WebForm.                                                              authors table. The query that we will be using is a simple
   The final screen that appears is shown in figure 6.                select statement. Select * from authors.

32     ISUG TECHNICAL JOURNAL
SYBASE ASE 15          WITH     A S P. N E T   2.0




                                                                  Problem: After configuring your data source, your password
                                                                  does not get saved in the web.config file.
                                                                  Resolution: Add the password as given below in your
                                                                  web.config file under the connection string setting.

                                                                     <connectionStrings>
                                                                     <add name="ConnectionString"
                                                                     connectionString="DSN=SybaseASE15;UID=your ase
                                                                     username;PWD=your ase password"
                                                                     providerName="System.Data.Odbc"/>
                                                                     </connectionStrings>

Figure 9
                                                                  After making the appropriate changes, we now have our Grid




                                                                                                                                       DESIGN & DEVELOPMENT
                                                                  View configured and we are ready to run the application.
                                                                     Our final application will appear as shown in figure 13.




Figure 10

At this point you have the option to customize your query by
clicking on the Query Builder button. We are not going to be
doing anything with our query so let’s move along. Click next
and in the last section let’s make sure that we get the desired   Figure 13
results – so click on the Test Query button. This is shown in
figure 10.                                                        You should be able to view the final application as shown
    Click Finish to complete the configuration.                   in the browser with page 1 and page 3 screens below.
    There can be times when a table consists of a thousand or         To demonstrate the sorting functionality click on the
more rows; it’s not advisable to load all the rows onto one       au_fname link and see how all author’s first names are
page, so therefore Pagination needs to be enabled for our Grid    alphabetized. This is shown in the figure 14.
View control. To enable Pagination, Sorting and Selection
click on the three checkboxes as shown in figure 11.
    Our Grid View is now ready. You may want to auto-format
your Grid View and Details View for clearer presentation.
    Now press F5 to run the application.




Figure 11                                                         Figure 14

You’ll now see a figure like the one shown below in figure 12.    Wow, now wasn’t that easy to work with Sybase ASE 15 using
                                                                  ASP.NET?
                                                                     There are more incredible things you can do; I’ll let you
                                                                  know about more options in forthcoming features and tutorials.
                                                                     Sybase is a great database platform - and you can leverage
                                                                  your existing skills from SQL Server to Sybase by following
                                                                  what is a very efficient learning curve. ■
Figure 12

                                                                                                      M AY- J U N E 2 0 0 8      33

Más contenido relacionado

La actualidad más candente

BoxGrinder – FOSDEM 2012
BoxGrinder – FOSDEM 2012BoxGrinder – FOSDEM 2012
BoxGrinder – FOSDEM 2012marekgoldmann
 
Vmware tools-installation-configuration
Vmware tools-installation-configurationVmware tools-installation-configuration
Vmware tools-installation-configurationRam Prasad Ohnu
 
websphere commerce server admin configuration
websphere commerce server admin configuration websphere commerce server admin configuration
websphere commerce server admin configuration Laxmi Kanth Kshatriya
 
Application lifecycle management in SharePoint
Application lifecycle management in SharePointApplication lifecycle management in SharePoint
Application lifecycle management in SharePointJeremy Thake
 
Continuous Delivery with Grails and CloudBees
Continuous Delivery with Grails and CloudBeesContinuous Delivery with Grails and CloudBees
Continuous Delivery with Grails and CloudBeesMarco Vermeulen
 
Installing Websphere Portal in the IBM Smartcloud
Installing Websphere Portal in the IBM SmartcloudInstalling Websphere Portal in the IBM Smartcloud
Installing Websphere Portal in the IBM SmartcloudDjalma Britto
 
OS-free server application delivery for instant provisioning
OS-free server application delivery for instant provisioningOS-free server application delivery for instant provisioning
OS-free server application delivery for instant provisioningAppZero
 

La actualidad más candente (9)

BoxGrinder – FOSDEM 2012
BoxGrinder – FOSDEM 2012BoxGrinder – FOSDEM 2012
BoxGrinder – FOSDEM 2012
 
Office 365 ProPlus: Click-to-run deployment and management
Office 365 ProPlus: Click-to-run deployment and managementOffice 365 ProPlus: Click-to-run deployment and management
Office 365 ProPlus: Click-to-run deployment and management
 
Vmware tools-installation-configuration
Vmware tools-installation-configurationVmware tools-installation-configuration
Vmware tools-installation-configuration
 
websphere commerce server admin configuration
websphere commerce server admin configuration websphere commerce server admin configuration
websphere commerce server admin configuration
 
Application lifecycle management in SharePoint
Application lifecycle management in SharePointApplication lifecycle management in SharePoint
Application lifecycle management in SharePoint
 
Continuous Delivery with Grails and CloudBees
Continuous Delivery with Grails and CloudBeesContinuous Delivery with Grails and CloudBees
Continuous Delivery with Grails and CloudBees
 
Installing Websphere Portal in the IBM Smartcloud
Installing Websphere Portal in the IBM SmartcloudInstalling Websphere Portal in the IBM Smartcloud
Installing Websphere Portal in the IBM Smartcloud
 
OS-free server application delivery for instant provisioning
OS-free server application delivery for instant provisioningOS-free server application delivery for instant provisioning
OS-free server application delivery for instant provisioning
 
Don't Put Your WordPress Site at Risk
Don't Put Your WordPress Site at RiskDon't Put Your WordPress Site at Risk
Don't Put Your WordPress Site at Risk
 

Similar a Sybase and ASP.NET2.0 Article

nOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptnOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptwebhostingguy
 
Deploy applications with TFS Build
Deploy applications with TFS BuildDeploy applications with TFS Build
Deploy applications with TFS BuildGian Maria Ricci
 
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...Anil Sharma
 
Asp dotnet net core
Asp dotnet net coreAsp dotnet net core
Asp dotnet net coreJaganathRao
 
What's new in microsoft dynamics ax7
What's new in microsoft dynamics ax7What's new in microsoft dynamics ax7
What's new in microsoft dynamics ax7Sameh Senosi
 
Cloud: Publish First Web Application to Azure Using Visual Studio
Cloud: Publish First Web Application to Azure Using Visual StudioCloud: Publish First Web Application to Azure Using Visual Studio
Cloud: Publish First Web Application to Azure Using Visual StudioMarvin Heng
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databasestechbed
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateAdam John
 
Guide to Vite JS – Modern Fron-End Development Tool
Guide to Vite JS – Modern Fron-End Development ToolGuide to Vite JS – Modern Fron-End Development Tool
Guide to Vite JS – Modern Fron-End Development ToolAlbiorix Technology
 
Install, configure and customize TFS 2013
Install, configure and customize TFS 2013Install, configure and customize TFS 2013
Install, configure and customize TFS 2013Davide Benvegnù
 
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...PVS-Studio
 
Visual studio 2017 - What's New
Visual studio 2017   - What's NewVisual studio 2017   - What's New
Visual studio 2017 - What's NewAmal Dev
 
The Business Benefits of GitOps
The Business Benefits of GitOpsThe Business Benefits of GitOps
The Business Benefits of GitOpsVMware Tanzu
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 serversMark Myers
 
IBM z/OS Provisioning Toolkit v1.0.2
IBM z/OS Provisioning Toolkit v1.0.2IBM z/OS Provisioning Toolkit v1.0.2
IBM z/OS Provisioning Toolkit v1.0.2Matthew Webster
 

Similar a Sybase and ASP.NET2.0 Article (20)

nOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptnOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.ppt
 
Asp.net core tutorial
Asp.net core tutorialAsp.net core tutorial
Asp.net core tutorial
 
Deploy applications with TFS Build
Deploy applications with TFS BuildDeploy applications with TFS Build
Deploy applications with TFS Build
 
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
 
Beginners introduction to asp.net
Beginners introduction to asp.netBeginners introduction to asp.net
Beginners introduction to asp.net
 
Asp dotnet net core
Asp dotnet net coreAsp dotnet net core
Asp dotnet net core
 
What's new in microsoft dynamics ax7
What's new in microsoft dynamics ax7What's new in microsoft dynamics ax7
What's new in microsoft dynamics ax7
 
Asp-net
 Asp-net Asp-net
Asp-net
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
Cloud: Publish First Web Application to Azure Using Visual Studio
Cloud: Publish First Web Application to Azure Using Visual StudioCloud: Publish First Web Application to Azure Using Visual Studio
Cloud: Publish First Web Application to Azure Using Visual Studio
 
Asp.net Web Development.pdf
Asp.net Web Development.pdfAsp.net Web Development.pdf
Asp.net Web Development.pdf
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databases
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New Update
 
Guide to Vite JS – Modern Fron-End Development Tool
Guide to Vite JS – Modern Fron-End Development ToolGuide to Vite JS – Modern Fron-End Development Tool
Guide to Vite JS – Modern Fron-End Development Tool
 
Install, configure and customize TFS 2013
Install, configure and customize TFS 2013Install, configure and customize TFS 2013
Install, configure and customize TFS 2013
 
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...
Support of Visual Studio 2017 and Roslyn 2.0 in PVS-Studio: sometimes it's no...
 
Visual studio 2017 - What's New
Visual studio 2017   - What's NewVisual studio 2017   - What's New
Visual studio 2017 - What's New
 
The Business Benefits of GitOps
The Business Benefits of GitOpsThe Business Benefits of GitOps
The Business Benefits of GitOps
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
IBM z/OS Provisioning Toolkit v1.0.2
IBM z/OS Provisioning Toolkit v1.0.2IBM z/OS Provisioning Toolkit v1.0.2
IBM z/OS Provisioning Toolkit v1.0.2
 

Más de ANIL MAHADEV

Delphi developer certification study guide
Delphi developer certification study guideDelphi developer certification study guide
Delphi developer certification study guideANIL MAHADEV
 
RAD Studio XE4 Product Reviewers Guide
RAD Studio XE4 Product Reviewers GuideRAD Studio XE4 Product Reviewers Guide
RAD Studio XE4 Product Reviewers GuideANIL MAHADEV
 
ER/Studio XE3 DataSheet
ER/Studio XE3 DataSheetER/Studio XE3 DataSheet
ER/Studio XE3 DataSheetANIL MAHADEV
 
DB PowerStudio XE DataSheet
DB PowerStudio XE DataSheetDB PowerStudio XE DataSheet
DB PowerStudio XE DataSheetANIL MAHADEV
 
RAD Studio XE4 Data Sheet
RAD Studio XE4 Data SheetRAD Studio XE4 Data Sheet
RAD Studio XE4 Data SheetANIL MAHADEV
 
IBM DB2 App Development with Microsoft Visual C#
IBM DB2 App Development with Microsoft Visual C#IBM DB2 App Development with Microsoft Visual C#
IBM DB2 App Development with Microsoft Visual C#ANIL MAHADEV
 
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...ANIL MAHADEV
 

Más de ANIL MAHADEV (8)

409-4973373
409-4973373409-4973373
409-4973373
 
Delphi developer certification study guide
Delphi developer certification study guideDelphi developer certification study guide
Delphi developer certification study guide
 
RAD Studio XE4 Product Reviewers Guide
RAD Studio XE4 Product Reviewers GuideRAD Studio XE4 Product Reviewers Guide
RAD Studio XE4 Product Reviewers Guide
 
ER/Studio XE3 DataSheet
ER/Studio XE3 DataSheetER/Studio XE3 DataSheet
ER/Studio XE3 DataSheet
 
DB PowerStudio XE DataSheet
DB PowerStudio XE DataSheetDB PowerStudio XE DataSheet
DB PowerStudio XE DataSheet
 
RAD Studio XE4 Data Sheet
RAD Studio XE4 Data SheetRAD Studio XE4 Data Sheet
RAD Studio XE4 Data Sheet
 
IBM DB2 App Development with Microsoft Visual C#
IBM DB2 App Development with Microsoft Visual C#IBM DB2 App Development with Microsoft Visual C#
IBM DB2 App Development with Microsoft Visual C#
 
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...
An introduction to_application_development_in_ibm_db2_udb_using_microsoft_vis...
 

Último

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Último (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

Sybase and ASP.NET2.0 Article

  • 1. Sybase ASE 15 with ASP.NET 2.0 By Anil Mahadev Anil Mahadev provides the ISUG ybase continues to make significant Software requirements Technical Journal with a ‘QuickStart’ tutorial on web S enhancements to its flagship enter- prise class database Adaptive Server Enterprise (ASE). The release of version 1) Windows 2000 and above. 2) A personal copy of SYBASE ASE 15 (Any edition will do, as we are devel- application development with 15 in 2005 along with its subsequent sib- oping for test purposes only, I will be Sybase ASE 15 and ASP.NET 2.0 lings, 15.0.1 and 15.0.2, in later years has using the Developer Edition of awoken the curiosity of more and more SYBASE ASE 15 for Windows.) developers who are now taking ASE for a You can download SYBASE ASE 15 spin. Couple this with Sybase's commit- from the Sybase website and try it out. ment to supporting additional develop- It’s FREE for development purposes ment platforms, like .NET and J2EE in only (not to be deployed in a produc- addition to Power Builder - and you can tion environment) as specified by the see why this is an exciting time for us license agreement. www.sybase.com/ developers. ase_1500devel 3) Microsoft Visual Studio.NET 2005 What has changed? (Professional or Team System) - you Sybase ASE and .NET have now become can order a free Trial DVD from so much easier to use than the previous Microsoft. releases – and Visual Studio 2005 promises 4) Install the SYBASE ASE 15 Data a whole lot of features that Sybase has Provider for ADO.NET during the taken advantage of in its Data Window installation of SYBASE ASE 15. .NET software. In this piece, We shall be using the pubs2 sample I am happy to share with you my database and authors table. For those experience of using SYBASE ASE 15 of you who do not have the pubs2 with ASP.NET 2.0 within the Visual database installed. Follow these steps Studio 2005 IDE – and I’m going to do to install them on your ASE Server. so without writing a single line of code. a) Open Interactive SQL and from In VS 2005 and ASP.NET 2.0, using the File Menu choose Run Script. ASE 15 has never been as good as it is b) Navigate to your Sybase ASE now. In this first segment, I will take you installation folder and drill down through building a data-driven website to the scripts folder. using Sybase ASE 15’s ADO.NET Data c) Under that, filter by all files and Provider with ASP.NET 2.0. The goal of choose pubs2. the application is that it must display the d) Now the database starts getting Anil Mahadev is an experienced data- authors from the authors table, it must created for you – and you can view base consultant and writer on database also perform sorting and pagination. it from within Sybase Central. technologies with several years training We are going to be using the Grid Now that we have our database and tables & consulting experience. He is View Control for this – so here are the ready, we can visually build applications in available at anilm001@gmail.com requirements for this tutorial. Visual Studio 2005. 30 ISUG TECHNICAL JOURNAL
  • 2. SYBASE ASE 15 WITH A S P. N E T 2.0 Steps to building the application You can download SYBASE ASE 15 from the Launch Visual Studio 2005. Click on File ➠ New Website. Now you can choose the language and select from C# or VB Sybase website and try it out. It’s FREE for as shown in figure 1. development purposes only and not to be deployed in a production environment as specified by the license agreement. DESIGN & DEVELOPMENT Figure 1 We now will be in the source view by default – so switch to the Design View. Then you can add the following controls onto the page and set their properties as indicated in the table below. Control Name Properties Label Control Building ASP.NET Apps with Figure 2 Sybase ASE 15 GridView Control None needed - only Our application should now look like figure 3. configuration required. We now have our controls in place so we need to perform one more step before proceeding. We need to add a reference to the ASE Data Provider Namespace Assembly. a) Right click on the Project and choose Add reference. Now under the tabs, choose under the .NET tab you can see the Sybase.Data.AseClient or alternatively you can navigate to the Sybase ASE Installation folder x:SYBASEASE15DataAccessADONETdll where x is your drive in your own hard drive. Figure 3 Next choose the Sybase.Data.AseClient.dll. Then click on OK and your project now hosts the ASE for .NET Assembly Configuring our Data Source as shown below. The Sybase ASE .NET Client is registered as We are now going to create a new connection to the ASE a Native Assembly within the Windows operating system. Server. Click on your Grid View Control and under Data This is shown in figure 2. Source choose New Data Source. M AY- J U N E 2 0 0 8 31
  • 3. SYBASE ASE 15 WITH A S P. N E T 2.0 Under Data Sources➠Data Source Configuration Wizard choose create a new Connection. Now we will need to build a new Sybase Data Source. Under the System DSN Tab, click new and choose Adaptive Server Enterprise as the chosen database server. Now you will be taken to a dialog where you will need to specify an existing connection to a Sybase ASE 15 database. The connection dialog will be as shown in the figure 4. Figure 6 Configuring the grid view You will need to choose the connection you have created to connect to Sybase ASE 15. Click next and give this ConnectionString a name, say, pubs2 - and then you have the option to re-use this connection string for multiple pages. Click ‘next’ as shown in figure 7. Figure 4 Next you will need to test the connection. Once you get a Figure 7 message that says Login Succeeded, it means that the connec- tion to your server is now ready. You will be asked to select a table from Sybase ASE 15. Since [Note: As a security measure ASE does not allow the user to only the views are displayed, choose the ‘Specify a custom enter the password directly. Instead the user is given an option to SQL statement’ option and manually enter the SQL enter the password in the next dialog once the user clicks on Test Statement by clicking next as shown in figure 8. Connection.] You will now get a message (as shown in figure 5) for successful connection. Figure 5 Reasons for connections not succeeding 1) Check your Server status ➠ Running. 2) Check the port numbers on your machines. 3) Verify the credentials. The Data Source name will be the connection parameter Figure 8 that the GridView will take when connecting to your Sybase ASE Database Server and displaying the contents onto your We will now get a list of all the author details from the WebForm. authors table. The query that we will be using is a simple The final screen that appears is shown in figure 6. select statement. Select * from authors. 32 ISUG TECHNICAL JOURNAL
  • 4. SYBASE ASE 15 WITH A S P. N E T 2.0 Problem: After configuring your data source, your password does not get saved in the web.config file. Resolution: Add the password as given below in your web.config file under the connection string setting. <connectionStrings> <add name="ConnectionString" connectionString="DSN=SybaseASE15;UID=your ase username;PWD=your ase password" providerName="System.Data.Odbc"/> </connectionStrings> Figure 9 After making the appropriate changes, we now have our Grid DESIGN & DEVELOPMENT View configured and we are ready to run the application. Our final application will appear as shown in figure 13. Figure 10 At this point you have the option to customize your query by clicking on the Query Builder button. We are not going to be doing anything with our query so let’s move along. Click next and in the last section let’s make sure that we get the desired Figure 13 results – so click on the Test Query button. This is shown in figure 10. You should be able to view the final application as shown Click Finish to complete the configuration. in the browser with page 1 and page 3 screens below. There can be times when a table consists of a thousand or To demonstrate the sorting functionality click on the more rows; it’s not advisable to load all the rows onto one au_fname link and see how all author’s first names are page, so therefore Pagination needs to be enabled for our Grid alphabetized. This is shown in the figure 14. View control. To enable Pagination, Sorting and Selection click on the three checkboxes as shown in figure 11. Our Grid View is now ready. You may want to auto-format your Grid View and Details View for clearer presentation. Now press F5 to run the application. Figure 11 Figure 14 You’ll now see a figure like the one shown below in figure 12. Wow, now wasn’t that easy to work with Sybase ASE 15 using ASP.NET? There are more incredible things you can do; I’ll let you know about more options in forthcoming features and tutorials. Sybase is a great database platform - and you can leverage your existing skills from SQL Server to Sybase by following what is a very efficient learning curve. ■ Figure 12 M AY- J U N E 2 0 0 8 33