I finally made some time to play with the IBM Database Add-ins for Visual Studio 2005 V9.5
today. Simply dragging and dropping a data source onto a form resulted in a working BREAD (Browse, Read, Edit, Add, Delete) Windows application with no coding:
I used the recent developerWorks article
by Vasantha Jayakumar
as my guide. Below are some notes made while following it. They will make more sense if you read them after looking through the article.
If you want to use the Visual Studio Add-ins with IDS make sure you:Finding the Server Explorer
Once I'd installed Data Server Client (including the Visual Studio Add-Ins) and launched Visual Studio 2005, my first challenge was to find the Visual Studio Server Explorer
tool which was hidden under the View->Other Windows
menu. Now with a glimmering of experience I use the "Ctrl-Alt-s" key combination to bring it up.Adding a Connection
First I made sure my IDS data server was listening on a DRDA port. DRDA is the underlying communication protocol used by Data Server Client. IDS supports both the Informix-specific SQLI protocol and the IBM DRDA protocol in 11.10.
Setting up IDS 11.10 to communicate via DRDA is a simple 2 step process. Here's what I did for IDS on Windows:
- Add a DBSERVERALIASES ONCONFIG entry like: DBSERVERALIASES mydrda_server
- Create a corresponding SQLHOSTS entry that specifies the DRSOCTCP protocol
That's all there is to it. Fortunately recent versions of setnet32
(3.00.TC3 and higher) support DRDA so I could define the server SQLHOSTS entry without editing the Registry by adding it in the setnet32 Server
If you have an older version of setnet32 you can add DRDA SQLHOSTS entries manually by editing HKEY_LOCAL_MACHINE\Software\Informix\SQLHOSTS
and adding a key with a name matching the DBSERVERALIASES value, following the same format as pre-existing entries except with DRSOCTCP as the PROTOCOL.
When defining a new Data Connection in Server Explorer, use machine:port for the server name. Below is the Add Connection screen I used for a machine called swamp.
Once the connection was working it was easy to follow the steps in Vasantha's article. Tweaking the look and feel of a simple database application is a matter of editing the properties of the DataGridView in the Visual Studio editor. When editing a C# Windows application in Visual Studio there are two tabs, one showing a design view of the application, and one showing the C# supporting methods:
I'll confess to not being a C# programmer but the ease of creating a simple GUI C# application using these add-ins was encouraging. Now I'll start thinking of a practical application to tempt me to learn a little more.[Read More