Building Informix Data- Driven Applications with.Net Sean R. Durity Manager of IT CornerCap Investment Counsel Informix User Forum 2006 Washington, D.C.

Slides:



Advertisements
Similar presentations
17. Data Access ADO.Net Architecture New Features of ADO.NET
Advertisements

ADO vs ADO.NET ADOADO.NET Client/server coupledDisconnected collection of data from data server Uses RECORDSET object (contains one table) Uses DATASET.
Rajesh Nair & Chris Golledge Kansas City, MO January 30, 2004 IDS and.NET.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
ADO. NET. What is “ADO.Net”? ADO.Net is a new object model for dealing with databases in.Net. Although some of the concepts are similar to the classical.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Passage Three Introduction to Microsoft SQL Server 2000.
SQLite and the.NET Framework This PPT:
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
ADO.NET – part II August 2004 [ Marmagna Desai]. CONTENTS ADO vs ADO.NET ADO.NET – Managed providers Connecting to Database SqlConnection Selecting Database.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Visual Studio ®.NET Data with XML Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft Modified.
Accessing Informix With ADO.Net Sean R. Durity Manager of IT CornerCap Investment Counsel Informix User Forum 2005 Moving Forward With Informix Atlanta,
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Developing Web Applications Using Microsoft ® Visual Studio ® 2008.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Tom Castiglia Hershey Technologies
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
Neal Stublen Populating a Database  SQLExpress should be installed with Visual Studio  The book provides a.sql file for populating.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
ADO.Net CS795. What is ADO.Net? Database language spoken by managed applications ADO.net database accesses go through modules: data providers –SQL Server.Net.
.NET Data Access and Manipulation ADO.NET. Overview What is ADO.NET? Disconnected vs. connected data access models ADO.NET Architecture ADO.NET Core Objects.
MySQL Connection using ADO.Net Connecting to MySQL from.NET Languages.
Database, SQL, and ADO.NET- Part 1 Session 11 Mata kuliah: M0874 – Programming II Tahun: 2010.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL ADO.Net Basics Ruwan Wijesinghe Trainer.
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
ASP.NET Rina Zviel-Girshin Lecture 5
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
ADO.NET Data Access. Page  2 SQL  When we interact with the datasource through ADO.NET we use the SQL language to retrieve,modify,update information.
Christopher M. Pascucci.NET Programming: Databases & ADO.NET.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Introduction to ADO.NET ADO.NET - Lesson 01  Training time: 10 minutes  Author:
Object Oriented Software Development 10. Persistent Storage.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
C# Programming in Depth Prof. Dr. Bertrand Meyer March 2007 – May 2007 Chair of Software Engineering Lecture 10: Database Lisa (Ling) Liu.
1 11/10/05CS360 Windows Programming ADO.NET. 2 11/10/05CS360 Windows Programming ADO.NET  Behind every great application is a database manager o Amazon.
ADO.Net TableAdapters and TableAdapterManager Code Camp 2008 Emmet Gray
Why ADO.NET Not your father’s Data Access.
The Problems HTTP is disconnected So many database vendors Create a simple consistent versatile interface on the data Look at ADO.NET classes OleDb SQL.
Mauricio Featherman, Ph.D. Washington St. University
Distributed Database Systems INF413. ADO.NET is a set of classes that comes with the Microsoft.NET framework to facilitate data access from managed languages.
ADO.Net CS795. What is ADO.Net? Database language spoken by managed applications ADO.net database accesses go through modules: data providers –SQL Server.Net.
HNDIT Rapid Application Development
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
C# .NET Software Development
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
SSMS SQL Server Management System. SQL Server Microsoft SQL Server is a Relational Database Management System (RDBMS) Relational Database Management System.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
C# 1 CSC 298 ADO.NET. C# 2 ADO.NET  A data access technology that maps very well to the world of the web (disconnected architecture)  data is retrieved.
 ADO.NET is an object-oriented set of libraries that allows you to interact with data sources  Commonly, the data source is a database, but it could.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
Data Access with ADO.NET
Introduction to Database Processing with ADO.NET
Data Virtualization Demoette… ADO.NET Client
Programming the Web Using ASP.Net
Lecture 6 VB.Net SQL Server.
VB.NET Using Database.
Principles of report writing
MySQL Connection using ADO.Net
Chapter 10 ADO.
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Windows Forms in Visual Studio 2005: An in-depth look at key features
Presentation transcript:

Building Informix Data- Driven Applications with.Net Sean R. Durity Manager of IT CornerCap Investment Counsel Informix User Forum 2006 Washington, D.C. December 8-9, 2006

Agenda The IBM Informix ADO.Net Driver ADO.Net Driver Basics (with examples) Building A Real Application (demo) Q & A

The Informix ADO.Net Driver Current version is Client SDK 2.90TC6 Now installed by default, must have.Net framework 1 st (works with either 1.1 or 2.0 framework) Namespace is IBM.Data.Informix - reference the library IBM.Data.Informix.dll Client SDK must be installed on any client that will use the driver (not self-contained in the.dll) Current documentation and examples are better than the previous ones; reference guide twice as long Objects are similar to Microsoft’s Sql* objects, but use “Ifx” prefix (IfxConnection, IfxCommand, etc.)

The Informix ADO.Net Driver Installation Issues –If you have the older driver (2.81), you should either install into the same directory or remove the previous installation first. I could not get the two versions to peacefully co-exist. –There is a stored procedure creation script that must be run once against the sysmaster database (as user ‘informix’). Otherwise, features like the DataAdapter wizard won’t connect. Script is $INFORMIXDIR/etc/cdotnet.sql on any client machine.

The Informix ADO.Net Driver New features in 2.90 –Adds an IfxDataAdapter Configure Data Adapter wizard –Adds new types including IfxDateTime, IfxDecimal, IfxBlob, and IfxClob –Supports IPv6 protocol

The Informix ADO.Net Driver Basics Connection String (getting a connection) –Semi-colon delimited list of attributes put into the ConnectionString property of the IfxConnection object string ConnectionString = "Host=" + HOST + "; " + "Service=" + SERVICENUM + "; " + "Server=" + SERVER + "; " + "Database=" + DATABASE + "; " + "User Id=" + USER + "; " + "Password=" + PASSWORD + "; "; IfxConnection conn = new IfxConnection(); conn.ConnectionString = ConnectionString; try { conn.Open(); } catch (IfxException ex) { }

The Informix ADO.Net Driver Basics Executing an insert, update or delete IfxCommand cmd = new IfxCommand("insert into test values (1, 2, ‘ABC’)",bconn.conn); cmd.CommandTimeout = 200; //seconds allowed for command to finish, default is 30 try { int rows = cmd.ExecuteNonQuery(); } catch (IfxException ex) { Console.WriteLine("Error "+ex.Message); }

The Informix ADO.Net Driver Basics Iterating through a SELECT’s result set one-time IfxCommand cmd = new IfxCommand("select * from test",bconn.conn); try { IfxDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { int a = dr.GetInt32(0); int b = Convert.ToInt32(dr["b"]); string c = (String)dr[2]; } dr.Close(); } catch (IfxException ex) { Console.WriteLine("Error "+ex.Message); }

The Informix ADO.Net Driver Basics Executing a Stored Procedure with “in” parameter IfxCommand cmd = new IfxCommand("test_proc",bconn.conn); cmd.CommandType = CommandType.StoredProcedure; //from System.Data cmd.Parameters.Add("in_parameter",2); //many ways to create these try { cmd.ExecuteScalar(); } catch (IfxException ifxe) { Console.WriteLine("Error "+ifxe.Message); }

ADO.Net 2.0 MicroSoft fixed some underlying problems with its DataSet implementation (indexing). For large DataSets it can provide an order of magnitude performance improvement. –Note: the current Informix driver has its own performance problems marshaling data from unmanaged to managed code. This also impacts the performance of large DataSets. Driver Availability from IBM – Open Beta just announced on (12/02/2006)

Building Data Applications The DataSet –Microsoft’s disconnected database object – like an in-memory database –One or more DataTables Each DataTable has a DataAdapter that interacts with the actual data store –Can have primary keys, relations, etc. –Derived from ComponentModel, so it is available in the Designer as graphical object

DataSet Diagram

Framework Considerations Concurrency checking –Could be implemented with interface and concurrency column Data binding – built-in can be flaky and not always bi- directional Data caching and lazy instantiation Can’t make DataSets “global” and still use designer- aided binding How to define relations between objects Null field checking; null objects allowed? How to send data across the wire in n-tier architecture Open source.Net ORM frameworks (like nHibernate) still emerging – no Informix-specific implementations that I have found

DevForce Framework from IdeaBlade

DevForce Editions Express – Free version: ORM, UI DataBinding, RAD features, one-click deployment, royalty free Professional – support for stored procedures, databinding to 3 rd party controls, multiple database connections, support Enterprise – Business Objects Server for n-tier deployment, disconnected or offline functionality, distributed transactions, web services objects (at CornerCap, we use this one)

DevForce Framework Particulars Uses OleDb for ORM (must run coledb script against sysmaster) No direct support for serial datatype, but I have Informix id generator code I am willing to share Includes its own object query language for writing queries (will probably move to LINQ. Pass-thru sql allowed.) Uses.Net Remoting for moving objects between tiers Concepts Guide is a must-read; other documentation, videos, and samples are good

DevForce – How Does it Work? ORM tool generates a DataRow class for each table/object (e.g., PlayerDataRow) Generates a descendent class from the DataRow (Player). This is where your custom code goes PersistenceManager class handles interactions with the database (no data adapters) BindingManagers handle UI binding Business objects have relationships that allow for “dot navigation” of properties from related objects Let’s go to the demo!

Q&A/Discussion Other Resources –DevForce framework ( especially read the Concepts Guide! –DevForce user group ( –Expert C# 2005 Business Objects, 2 nd ed. Rockford Lhotka (CSLA framework, if you want to do more of your own building. Many of the ideas are incorporated into DevForce) –IdeaBlade contact – Lisa Martin

Building Informix Data- Driven Applications with.Net Sean R. Durity Informix User Forum 2006 Washington, D.C. December 8-9, 2006