<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Innovative Systems, LLC</title>
	<atom:link href="http://www.innovativesys.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.innovativesys.net</link>
	<description>Home of FROG for the IBM iSeries</description>
	<lastBuildDate>Sun, 15 Jul 2012 02:38:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>.NET Journey &#8211; Convert System Date/Time to .Net DateTime</title>
		<link>http://www.innovativesys.net/?p=67</link>
		<comments>http://www.innovativesys.net/?p=67#comments</comments>
		<pubDate>Tue, 10 Feb 2009 19:51:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=67</guid>
		<description><![CDATA[I recently had a requirement of being able to get the current date and time from the system and use that value in a .Net program.  After trying a couple of approaches I chose to call the &#8220;Retrieve System Value&#8221; API and convert the system date/time to a .Net DateTime type. 
First, you will [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a requirement of being able to get the current date and time from the system and use that value in a .Net program.  After trying a couple of approaches I chose to call the &#8220;Retrieve System Value&#8221; API and convert the system date/time to a .Net DateTime type. </p>
<p>First, you will need to add a reference to the ActiveX control that allows your program to call programs on the system.  Right click the &#8220;References&#8221; section under your project and under the &#8220;COM&#8221; tab on the &#8220;Add Reference&#8221; dialog look for &#8220;IBM AS/4400 iSeries Access for Windows ActiveX Object Library&#8221;.  Add this to your solution.  Make sure to also add &#8220;using cwbx;&#8221; to your program.</p>
<p>Now the code to get the date/time and convert to .Net DateTime:</p>
<pre><span style="font-size: x-small;">        private DateTime GetDB2SystemDateTime()
        {</span></pre>
<pre><span style="font-size: x-small;">            DateTime sysDateTime = new DateTime();
            string wrkString;</span></pre>
<pre><span style="font-size: x-small;">            cwbx.AS400System AS400 = new cwbx.AS400System();
            cwbx.Program pgm = new cwbx.Program();
            cwbx.StringConverter strCnv = new cwbx.StringConverter();
            cwbx.LongConverter longCnv = new cwbx.LongConverter();
            cwbx.Structure ERRC0100 = new cwbx.Structure();
            cwbx.Structure SysValRcv = new Structure();
            cwbx.Structure SysValInfo = new Structure();</span></pre>
<pre><span style="font-size: x-small;">            // Define the connection and the program to call
            AS400.Define(db2Conn.DataSource);
            AS400.UserID = Properties.Settings.Default.iSeriesUser;
            AS400.Password = Properties.Settings.Default.iSeriesPwd;
            pgm.system = AS400;
            pgm.LibraryName = "*LIBL";
            pgm.ProgramName = "QWCRSVAL";</span></pre>
<pre><span style="font-size: x-small;">            // Connect to the remote command server
            try
            {
                AS400.Connect(cwbcoServiceEnum.cwbcoServiceRemoteCmd);
            }
            catch (Exception as400E)
            {
                fsw.WriteLine(LogFileDateTime() + "Error occured during AS400 logon: " + as400E.Message);
                fsw.Flush();
                return sysDateTime;
            }
            if (AS400.IsConnected(cwbcoServiceEnum.cwbcoServiceAny) == 0)
            {
                fsw.WriteLine(LogFileDateTime() + "Could not connect to AS400 remote command server");
                fsw.Flush();
                return sysDateTime;
            }</span></pre>
<pre><span style="font-size: x-small;">            // Create a parm structure for the system value receiver variable
            SysValInfo.Fields.Append("SystemValue", 10);
            SysValInfo.Fields.Append("TypeOfData", 1);
            SysValInfo.Fields.Append("InfoStatus", 1);
            SysValInfo.Fields.Append("LengthOfData", 4);
            SysValInfo.Fields.Append("Data", 20);</span></pre>
<pre><span style="font-size: x-small;">            // Create a parm structure for the system value data
            SysValRcv.Fields.Append("NumSysValsRtn", 4);
            SysValRcv.Fields.Append("SysValOffset", 4);
            SysValRcv.Fields.Append("SysValInfo", SysValInfo.Length);</span></pre>
<pre><span style="font-size: x-small;">            // Standard error reporting structure
            ERRC0100.Fields.Append("BytesProvided", 4);
            ERRC0100.Fields[1].Value = longCnv.ToBytes(272);
            ERRC0100.Fields.Append("BytesAvail", 4);
            ERRC0100.Fields[2].Value = longCnv.ToBytes(0);
            ERRC0100.Fields.Append("ExceptionID", 7);
            ERRC0100.Fields.Append("Reserved", 1);
            ERRC0100.Fields.Append("ExceptionData", 272);</span></pre>
<pre><span style="font-size: x-small;">            // Define the parms for the API call
            ProgramParameters parms = new ProgramParameters();
            parms.Append("RcvVar", cwbrcParameterTypeEnum.cwbrcOutput, SysValRcv.Length);
            parms.Append("RcvVarLen", cwbrcParameterTypeEnum.cwbrcInput, 4);
            parms["RcvVarLen"].Value = longCnv.ToBytes(parms["RcvVar"].Length);
            parms.Append("NumSysVals", cwbrcParameterTypeEnum.cwbrcInput, 4);
            parms["NumSysVals"].Value = longCnv.ToBytes(1);
            parms.Append("SysVals", cwbrcParameterTypeEnum.cwbrcInput, 10);
            parms["SysVals"].Value = strCnv.ToBytes("QDATETIME ");
            parms.Append("ErrorCode", cwbrcParameterTypeEnum.cwbrcInout, ERRC0100.Length);
            try
            {
                pgm.Call(parms);
            }
            catch (Exception callE)
            {
                fsw.WriteLine(LogFileDateTime() + "An error occured during API call to QWCRSVAL: " + callE.Message);
                fsw.Flush();
                AS400.Disconnect(cwbcoServiceEnum.cwbcoServiceAll);
                return sysDateTime;
            }
            ERRC0100.Bytes = parms["ErrorCode"].Value;
            SysValRcv.Bytes = parms["RcvVar"].Value;
            SysValInfo.Bytes = SysValRcv.Fields["SysValInfo"].Value;
            wrkString = strCnv.FromBytes(SysValInfo.Fields["Data"].Value);
            try
            {
                sysDateTime = DateTime.Parse(wrkString.Substring(0, 4) + "-" +
                                        wrkString.Substring(4, 2) + "-" +
                                        wrkString.Substring(6, 2) + "T" +
                                        wrkString.Substring(8, 2) + ":" +
                                        wrkString.Substring(10, 2) + ":" +
                                        wrkString.Substring(12, 2) + "." +
                                        wrkString.Substring(14));
            }
            catch (Exception dtE)
            {
                fsw.WriteLine(LogFileDateTime() + "Error occured extracting AS400 date/time: " + dtE.Message);
                fsw.Flush();
            }
            AS400.Disconnect(cwbcoServiceEnum.cwbcoServiceAll);
            return sysDateTime;</span></pre>
<pre><span style="font-size: x-small;">        }

Note the ERRC0100, SysValRcv and SysValInfo variables.  These are a type of cwbx.Structure and you can think of these are creating data structures programatically.  Also note the "fsw" object...this is basically a text file write that I'm using to log errors during the conversion process and is defined in the main section of my class as a type of StreamWriter.
</span></pre>
<p><span style="font-size: x-small;">When this routine is called it returns the system date/time converted to a .Net DateTime value or a DateTime value with the default for the object type.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=67</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Journey &#8211; The Sensei Revealed</title>
		<link>http://www.innovativesys.net/?p=32</link>
		<comments>http://www.innovativesys.net/?p=32#comments</comments>
		<pubDate>Thu, 14 Aug 2008 15:25:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=32</guid>
		<description><![CDATA[Hopefully no one has gotten the impression that I&#8217;m clever enough to figure out this .Net stuff on my own.  I did get a book from Borders to start off with but for the iSeries specific stuff I&#8217;ve had some help along the way.  My sensei (unbeknownst to him) has been Colm Byrne [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully no one has gotten the impression that I&#8217;m clever enough to figure out this .Net stuff on my own.  I did get a book from Borders to start off with but for the iSeries specific stuff I&#8217;ve had some help along the way.  My sensei (unbeknownst to him) has been Colm Byrne from his <a href="http://www.aranrock.com/C_sharp_for_RPG_Programmers/">Don Net Fluke</a> blog.  He&#8217;s got examples AND some videos for instruction.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Journey &#8211; Data Grid Example &#8211; Part 1</title>
		<link>http://www.innovativesys.net/?p=29</link>
		<comments>http://www.innovativesys.net/?p=29#comments</comments>
		<pubDate>Wed, 13 Aug 2008 15:46:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=29</guid>
		<description><![CDATA[In this installment of the .NET journey we&#8217;re going to create a small but useful program to query the DB2 database.  Later we&#8217;ll add code to export the data to Excel!  How cool is that?
Creating the Project
In Visual Studio 2005, create a new Windows form project.  To do this, start your version [...]]]></description>
			<content:encoded><![CDATA[<p>In this installment of the .NET journey we&#8217;re going to create a small but useful program to query the DB2 database.  Later we&#8217;ll add code to export the data to Excel!  How cool is that?</p>
<h2>Creating the Project</h2>
<p>In Visual Studio 2005, create a new Windows form project.  To do this, start your version of Visual Studio and click the &#8220;Create project&#8230;&#8221; link in VS &#8220;Start Page&#8221;.  You&#8217;ll then be prompted for the type of application to created.  Select &#8220;Windows Appliction&#8221;. </p>
<h2>Adding Controls</h2>
<p>Once the project is created on the right hand side will be a window titled &#8220;Solution Explorer &#8211; yourproject name&#8221;.  In the middle will be a &#8220;Form1.cs [Design]&#8221; tab with a small blank window.  Make the window a little bigger by dragging the corner of the window.  For this example we&#8217;ll add the following controls to the window:</p>
<ul>
<li>A text box for the host name</li>
<li>A text box for the SQL statement to execute</li>
<li>A data grid view</li>
<li>A button to execute the query</li>
</ul>
<p>On the left hand side of VS should be a box with the word &#8220;Toolbox&#8221; orientated on it&#8217;s side.  Let your mouse hover over this and a toolbox should appear.  If you don&#8217;t have this select &#8220;View | Toolbox&#8221; from the menu.  Now select the &#8220;Label&#8221; tool from the toolbox and drop it on your form.  Move the label so it&#8217;s in the upper left hand corner of the window.  Now select a &#8220;Textbox&#8221; tool and drop it on your form.  Move this so it&#8217;s to the right of the label control you dropped earlier.  You&#8217;ll notice that as you get close to the label VS presents aligment guides to help you place the control on the same X axis as the label.</p>
<p>Now we need to change the visible text for our label control.  Select the label control and on the left under the &#8220;Toolbox&#8221; there should be a box labeled &#8220;Properties&#8221;.  Let your mouse hover over this and the properties should appear.  If it doesn&#8217;t select &#8220;View | Properties Window&#8221; from the menu.  Locate the &#8220;Text&#8221; property and change this from &#8220;label1&#8243; to &#8220;System&#8221;.  Also make sure the text box you added next to the label is large enough (drag the right side of the control to change).</p>
<p>Now we&#8217;ll add controls for the SQL statement.  Add another label under the system label you added earlier and change the text to &#8220;SQL Statement&#8221;.  Add a text box to the right of this label and make the control wider.  Since we&#8217;re typing an SQL statement we want to have more than one line of text in the text box so we need to make it multi-line.  Open the properties window for the text box and change &#8220;Multiline&#8221; to true.  Now you can also change the height of the text box. </p>
<p>Next we&#8217;ll add a data grid view to the form.  Go back to the toolbox and drop a &#8220;DataGridView&#8221; onto the form.  Since the intent of this project is a simple read-only query tool, we don&#8217;t want users to type into this grid.  Locate the &#8220;AllowUserToAddRows&#8221; and &#8220;AllowUserToDeleteRows&#8221; in the object&#8217;s properties and change those to False.</p>
<p>For the last control we&#8217;ll add an &#8220;Execute&#8221; button.  Drop a &#8220;Button&#8221; object onto your form and move it to the left under the grid.  Change the text for the button to &#8220;Execute&#8221;.</p>
<h2>The First Test</h2>
<p>Just for grins, let&#8217;s run the program.  Click the &#8220;Run&#8221; button (green triangle) on the toolbar and your window should look something like this:</p>
<p><a href="http://www.innovativesys.net/wp-content/uploads/data-grid-example-1_1.bmp"></a><a href="http://www.innovativesys.net/wp-content/uploads/data-grid-example-1_1.bmp"></a></p>
<p> <a href="http://www.innovativesys.net/wp-content/uploads/data-grid-example-1_1.jpg"><img class="alignnone size-medium wp-image-31" title="data-grid-example-1_1" src="http://www.innovativesys.net/wp-content/uploads/data-grid-example-1_1-300x186.jpg" alt="" width="300" height="186" /></a></p>
<h2>Start Your Connection!</h2>
<p>Okay, now we need to add controls that let us connect to our iSeries. </p>
<p>First we need to add a reference to the IBM .Net data provider.  On the right hand side of VS under the &#8220;Solution Explorer&#8221; window there should be an outline of your project represented by a tree view.  Locate the &#8220;References&#8221; node, right click and select &#8220;Add Reference&#8221; from the popup menu.  Locate &#8220;IBM DB2 UDB for iSeries .NET Provider, highlight and click &#8220;Okay&#8221;.  Note that if you can&#8217;t find this provider then you need to install from the iSeries Access CD.</p>
<p>We need to make VS aware of the data controls available in the IBM .NET provider.  From the menu, select &#8220;Tools | Choose Toolbox Items&#8221;.  Under the &#8220;.NET Framework Components&#8221; tab you&#8217;ll find a list of items available for selection.  To find the ones we&#8217;re intersted in, type &#8220;IBM&#8221; in the filter underneath the list.  You should then see four items from the IBM.Data.DB2.iSeries namespace.  Select all four and click &#8220;Okay&#8221;.  These are now available on the &#8220;Toolbox&#8221; window and will be there for each subsequent project you create in VS 2005.</p>
<p>Now go to the &#8220;Toolbox&#8221; window and drag/drop a &#8220;iDB2Connection&#8221; object to your window.  Once you do, you&#8217;ll notice that VS shows the object in a space underneath the window you created earlier.  That&#8217;s because these components are not &#8220;visible&#8221;.  Now go back to the &#8220;Toolbox&#8221; and drag/drop a iDB2Command and iDB2DataAdapter to your window. </p>
<p>We need to link some of these together so click the &#8220;iDB2Command&#8221; object and under the &#8220;Properties&#8221; window locate the &#8220;Connection&#8221; property, click into the value and click the down arrow.  The small popup window should show only one available value and it should be the iDB2Connection object we dropped earlier.  Go ahead and select it. </p>
<p>Now select the &#8220;iDB2DataAdapter1&#8243; and locate &#8220;InsertCommand&#8221; in the object&#8217;s properties.  Click into the value, click the down arrow and select the iDB2Command object in the list.</p>
<p>We could also set the system name to connect to in the iDB2Connection object but since we&#8217;re allowing the user to enter a system name we&#8217;ll set it later in the program.</p>
<p>One more object to drop onto our form.  Locate a &#8220;DataSet&#8221; object and drop onto the form.  You&#8217;ll then be prompted to choose either a Typed or Untyped dataset.  Select Untyped and click Okay.</p>
<p>Now we need to link the data grid view to the data set we just added.  Click the data grid and locate &#8220;DataSource&#8221; in the object&#8217;s properties.  Click the down arrow which will present a window of data sources.  Expand &#8220;Other Data Sources&#8221; and there you will find &#8220;Form 1 list instances&#8221; (if you&#8217;ve changed the name of your form it will show differently).  Expand your form&#8217;s instances and you should find the dataset you just added.  Click the data set to select.</p>
<h2>Just A Little Code</h2>
<p>Now that all of our objects are present we can code!</p>
<p>Double-click the &#8220;Execute&#8221; button you added earlier and add the following code:</p>
<pre><span style="font-size: x-small; color: #000000;">            dataSet1.Clear(); // Clears the data in the data set
            try
            {
                dataSet1.Tables[0].Columns.Clear(); // Clears column information
            }
            catch { };
            // This code tells the iDB2Connection object which machine we're connecting to
            iDB2Connection1.ConnectionString = "DataSource=" + textBox1.Text;
            // Set the SQL statement to be executed
            iDB2Command1.CommandText = textBox2.Text;
            try
            {
                try
                {
                    // Fill the data set with our results
                    iDB2DataAdapter1.Fill(dataSet1);
                    // The data grid view will set column information automatically
                    dataGridView1.AutoGenerateColumns = true;
                    // Point the data grid view to the first (and only) table in the data set
                    dataGridView1.DataMember = dataSet1.Tables[0].TableName;
                }
                // This will catch communication type errors
                catch (IBM.Data.DB2.iSeries.iDB2CommErrorException CommError)
                {
                    MessageBox.Show(CommError.MessageDetails, CommError.Message);
                };
            }
            // This will catch SQL syntax errors
            catch (IBM.Data.DB2.iSeries.iDB2SQLErrorException SQLError)
            {
                MessageBox.Show(SQLError.Message);
            };
</span></pre>
<p>Note that if you changed any of the control&#8217;s names you may have to adjust the code. </p>
<h2>Time For A Test Drive</h2>
<p>Now let&#8217;s try it out!  Click the &#8220;Run&#8221; button in VS and if everything goes as planned, you should see your application running.  Test it by entering:</p>
<ul>
<li>Your iSeries name/IP address</li>
<li>An SQL statement that selects records from a small table.  To test, I use &#8220;select * from qgpl.qauoopt&#8221;. </li>
<li>Click &#8220;Execute&#8221;</li>
</ul>
<p>The data grid should now be populated with the data from the selected table.  A word of caution here&#8230;don&#8217;t issue a select statement that returns millions of rows.  Every row in the result set would be returned to your program before the data is displayed and that would not be good.</p>
<p>The data grid works much like the data grid in Excel.  You can resize rows and columns, double-click a column to fit the widest data, etc.  Play around with your new toy!</p>
<p>In the next installment of the .NET journey, we&#8217;ll add some bells/whistles to our example program.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=29</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Journey &#8211; First Example Explained</title>
		<link>http://www.innovativesys.net/?p=28</link>
		<comments>http://www.innovativesys.net/?p=28#comments</comments>
		<pubDate>Wed, 04 Jun 2008 03:32:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=28</guid>
		<description><![CDATA[So&#8230;you remember this?
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using IBM.Data.DB2.iSeries;

namespace iSeriesTester
{
    class Program
    {
        static void Main(string[] args)
        {
            String cnnString = "DataSource=xxxxxx";
    [...]]]></description>
			<content:encoded><![CDATA[<p>So&#8230;you remember this?</p>
<pre>using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using IBM.Data.DB2.iSeries;

namespace iSeriesTester
{
    class Program
    {
        static void Main(string[] args)
        {
            String cnnString = "DataSource=xxxxxx";
            bool connected = false;
            iDB2Connection cnn = new iDB2Connection();
            iDB2Command cmd = new iDB2Command();
            cmd.Connection = cnn;
            cnn.ConnectionString = cnnString;
            cmd.CommandText = "select * from qgpl.qauoopt";
            try
            {
                cnn.Open();
                connected = true;
            }
            catch (iDB2ConnectionFailedException)
            {
                MessageBox.Show("Could not connect to system!");
            }
            catch (iDB2CommErrorException e)
            {
                MessageBox.Show(e.MessageDetails);
            }

            if (connected)
            {
                iDB2DataReader reader;
                try
                {
                    reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        try
                        {
                            Console.WriteLine(reader.GetString(0) + " - " + reader.GetString(1));
                        }
                        catch
                        {
                            MessageBox.Show("An error occured retrieving data!");
                        }
                    }
                    reader.Close();
                }
                catch (iDB2SQLErrorException sqlE)
                {
                    MessageBox.Show(sqlE.Message);
                }
            }

            cnn.Close();
            cmd.Dispose();
        }

    }
}</pre>
<p>So let&#8217;s look at this program in detail.  First off is the &#8220;using&#8221; statement.  In .NET a using means which namespace in the .NET framework you&#8217;ll be using in your program.  It&#8217;s not really an &#8220;include&#8221; like C/C++ or Java.  AAMOF, if you search your computer for &#8220;System.Windows.Forms&#8221; you&#8217;ll only find a reference to a .DLL and .TLB. </p>
<p>So how do you know which namespace to include?  In the &#8220;Microsoft .NET Framework SDK v2.0&#8243; program group there&#8217;s an option for &#8220;Documentation&#8221;.  If you open the documentation and search for &#8220;String Class&#8221; you&#8217;ll find that it&#8217;s a part of the &#8220;System&#8221; namespace.  So if you want to use the &#8220;String&#8221; class you&#8217;ll need to have a &#8220;using System;&#8221; line.  Also note the &#8220;IBM.Data.DB2.iSeries&#8221; using statement.  If you search your computer for matching files you&#8217;ll find a reference to IBM.Data.DB2.iSeries.dll in &#8220;C:\Program Files\IBM\Client Access&#8221;.</p>
<p>The next line:</p>
<pre>namespace iSeriesTester</pre>
<p>Defines the namespace for the program.  This can be anything but it&#8217;s suggested that you organize your program&#8217;s namespace into a hierarchy.  For example, I could have used the namespace:</p>
<p>namespace InnovativeSystems.NETJourney.iSeriesTester</p>
<p>The &#8220;class Program&#8221; line is required in C# but doesn&#8217;t merit much discussion now.  In C# (as in C or C++) there must be a &#8220;main&#8221; function in each program.  In C# your main function will receive an array of strings which equate to the command line options, if any, supplied to your program.</p>
<p>Notice the iDB2Command and iDB2Connection objects declared in the &#8220;main&#8221; function.  These are defined in the &#8220;IBM.Data.DB2.iSeries&#8221; namespace.  The iDB2Command stores the actual SQL statement to be executed and iDB2Connection defines which system we&#8217;ll execute the statement against.  Once the command is created we attach the connection to the command via &#8220;cmd.Connection = cnn;&#8221; statement.</p>
<p>The next two lines:</p>
<pre>
cnn.ConnectionString = cnnString;<br />
cmd.CommandText = </p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Journey &#8211; The First Steps&#8230;</title>
		<link>http://www.innovativesys.net/?p=27</link>
		<comments>http://www.innovativesys.net/?p=27#comments</comments>
		<pubDate>Fri, 30 May 2008 03:07:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=27</guid>
		<description><![CDATA[Okay, so you&#8217;ve decided that you want to learn .NET and techniques related to connecting to the iSeries.  So do I!  For this blog, we&#8217;re going to concentrate on C#.  Why C# over the over available .NET languages?  It&#8217;s because I have more experience with C/C++ then I do with Visual [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so you&#8217;ve decided that you want to learn .NET and techniques related to connecting to the iSeries.  So do I!  For this blog, we&#8217;re going to concentrate on C#.  Why C# over the over available .NET languages?  It&#8217;s because I have more experience with C/C++ then I do with Visual Basic or Java.  I&#8217;m sure that the examples presented in this blog can be easily modified to work with any .NET language.</p>
<p>First you need to get the tools.  To start with, click <a href="http://www.microsoft.com/express/2005/">here </a>to download Visual Studio 2005 Express C# Edition.  As of this writing, VS 2008 is available but all my examples will be created with VS 2005.  Feel free to try VS 2008 but be aware that there will be differences and I won&#8217;t be able to explain why.   Then download and install the .NET 2.0 SDK from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;displaylang=en">here</a>.  The SDK has command line tools and documentation that wil be extremely helpful.</p>
<p>Also make sure your Windows version is up to date, especially concerning the .NET framework.</p>
<p>Now for the iSeries stuff.  You&#8217;ll need to be on at least V5R3 of OS/400 and make sure you have the latest service pack for your version of iSeries Access.  I know with V5R4 of iSeries Access that you will need to have the latest service pack as a bug in the .NET provider will cause your .NET app to crash upon termination.  IBM&#8217;s web site doesn&#8217;t guarantee that their provider will work with .NET 2.0 but so far I haven&#8217;t had any problems.</p>
<p>Once you have all your goodies installed, start up Windows notepad and paste the following code.  The only change you&#8217;ll need is to change the connection string (&#8220;DataSource=xxxxxx&#8221;) replacing &#8220;xxxxxx&#8221; with your system name or IP address.</p>
<pre>using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using IBM.Data.DB2.iSeries;

namespace iSeriesTester
{
    class Program
    {
        static void Main(string[] args)
        {
            String cnnString = "DataSource=xxxxxx";
            bool connected = false;
            iDB2Connection cnn = new iDB2Connection();
            iDB2Command cmd = new iDB2Command();
            cmd.Connection = cnn;
            cnn.ConnectionString = cnnString;
            cmd.CommandText = "select * from qgpl.qauoopt";
            try
            {
                cnn.Open();
                connected = true;
            }
            catch (iDB2ConnectionFailedException)
            {
                MessageBox.Show("Could not connect to system!");
            }
            catch (iDB2CommErrorException e)
            {
                MessageBox.Show(e.MessageDetails);
            }

            if (connected)
            {
                iDB2DataReader reader;
                try
                {
                    reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        try
                        {
                            Console.WriteLine(reader.GetString(0) + " - " + reader.GetString(1));
                        }
                        catch
                        {
                            MessageBox.Show("An error occured retrieving data!");
                        }
                    }
                    reader.Close();
                }
                catch (iDB2SQLErrorException sqlE)
                {
                    MessageBox.Show(sqlE.Message);
                }
            }

            cnn.Close();
            cmd.Dispose();
        }

    }
}</pre>
<p>Then save the file to a location on your PC. For this example I&#8217;m going to name the file &#8220;iSeriesTester.cs&#8221; and place the file in &#8220;My Documents&#8221;.</p>
<p>Now we&#8217;re going to compile and test the application. If you installed the .NET 2.0 SDK correctly then you should find the following option:</p>
<p>Start &#8211; All Programs &#8211; Microsoft .NET Framework SDK v2.0 &#8211; SDK Command Prompt</p>
<p>Once you select this option a DOS command prompt will appear. This prompt sets certain environment attributes for you to easily compile .NET code. Use the &#8220;CD&#8221; command to change to the directory where you saved the above .cs file. Now enter the following on the command prompt:</p>
<pre>csc /r:"C:\Program Files\IBM\Client Access\IBM.Data.DB2.iSeries.dll" iSeriesTester.cs</pre>
<p>If everything goes according to plan, the DOS prompt should appear again without any error messages. Now type &#8220;iSeriesTester&#8221; on the command prompt and press Enter. You should see the contents of QAUOOPT displayed in the prompt window.</p>
<p>Congratulations! You&#8217;ve just compiled your first .NET program!</p>
<p>In the next installment of the journey I&#8217;ll go into more detail about the program code and the command line option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=27</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Journey &#8211; What Is It?</title>
		<link>http://www.innovativesys.net/?p=26</link>
		<comments>http://www.innovativesys.net/?p=26#comments</comments>
		<pubDate>Sun, 25 May 2008 20:02:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET Journey]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=26</guid>
		<description><![CDATA[As you probably are aware, I enjoy writing PC applications.  If you&#8217;re reading this, you&#8217;ve probably heard of or used FROG.  FROG was created with a programming language called Euphoria and uses the database connectivity APIs from iSeries Access.  As much as I enjoy programming in Euphoria I realized that in order [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably are aware, I enjoy writing PC applications.  If you&#8217;re reading this, you&#8217;ve probably heard of or used <a href="http://www.innovativesys.net/?page_id=4">FROG</a>.  FROG was created with a programming language called Euphoria and uses the database connectivity APIs from iSeries Access.  As much as I enjoy programming in Euphoria I realized that in order to keep up with the latest technology available from IBM for connecting to the iSeries, I was going to have to learn .NET.  (I know, Java is another choice but I&#8217;m going down the .NET road).  Also, IBM will probably discontinue the database APIs in the future.</p>
<p>So, the &#8220;.NET Journey&#8221; is going to be a blog of my own experiences with .Net and the IBM iSeries geared toward helping others learn the same.  I&#8217;ve already developed some applications with .NET but I am by no means an expert.  Some of the journey will be my own learning experiences so if you&#8217;re interested, you can learn along with me.</p>
<p>The next installment of the journey will outline where to get the development tools and the requirements for your iSeries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FROG Testimonial!</title>
		<link>http://www.innovativesys.net/?p=25</link>
		<comments>http://www.innovativesys.net/?p=25#comments</comments>
		<pubDate>Mon, 19 May 2008 13:32:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FROG]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=25</guid>
		<description><![CDATA[If you&#8217;ve benefited from FROG and have a minute to spare, I&#8217;ve started collecting testimonials about FROG and would like to post them on this site.  Click here to go to the FROG testimonial page.
]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve benefited from FROG and have a minute to spare, I&#8217;ve started collecting testimonials about FROG and would like to post them on this site.  Click <a href="http://www.innovativesys.net/?page_id=23">here</a> to go to the FROG testimonial page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction Video</title>
		<link>http://www.innovativesys.net/?p=22</link>
		<comments>http://www.innovativesys.net/?p=22#comments</comments>
		<pubDate>Wed, 07 May 2008 03:21:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=22</guid>
		<description><![CDATA[I love WordPress!  I now have a plugin that allows me to create/post videos introducing FROG!  Check this out.
]]></description>
			<content:encoded><![CDATA[<p>I love WordPress!  I now have a plugin that allows me to create/post videos introducing FROG!  Check this out.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=22</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.innovativesys.net/wp-content/uploads/intro.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>WordPress!!!</title>
		<link>http://www.innovativesys.net/?p=21</link>
		<comments>http://www.innovativesys.net/?p=21#comments</comments>
		<pubDate>Tue, 06 May 2008 20:50:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.innovativesys.net/?p=21</guid>
		<description><![CDATA[As you are probably aware just by reading this post, I&#8217;ve changed the look and feel of this site.  Instead of coding all of the PHP myself I&#8217;ve switched to using the open source blogging software WordPress.  WordPress is extremely easy to install and administer.  I know what you&#8217;re saying to yourself: [...]]]></description>
			<content:encoded><![CDATA[<p>As you are probably aware just by reading this post, I&#8217;ve changed the look and feel of this site.  Instead of coding all of the PHP myself I&#8217;ve switched to using the open source blogging software <a href="http://www.wordpress.org">WordPress</a>.  WordPress is extremely easy to install and administer.  I know what you&#8217;re saying to yourself: &#8220;Why would you use blogging software for a website?&#8221;.  The answer is WordPress is not just blogging software.  It also contains a fairly comprehensive CMS feature subset (Content Management System). </p>
<p>The best part is WordPress&#8217; ability to be extended through the use of plugins.   Plugins are easy to install and most integrate into WordPress&#8217; admin very nicely.  Here&#8217;s a list of the plugins that I&#8217;m currently using:</p>
<ul>
<li>cformsII &#8211; all forms on this site are built with this plugin.  It has a TON of features and it&#8217;s extremely flexible</li>
<li>NextGen Gallery &#8211; the screen shots displayed on this site are handled by this plugin.  Excellent admin interface and simple to use.</li>
<li>Downloads Manager &#8211; the <a href="http://www.innovativesys.net/?page_id=7">Downloads</a> page on this site was created with this plugin.  It also has a built in download counter, which is something I didn&#8217;t have before.</li>
<li>AWA Easy Page Link &#8211; allows you to embed links to other pages on your site without typing the address.  Nice integration into the WordPress editor.</li>
<li>Tiny MCE Advanced &#8211; this plugin &#8220;unlocks&#8221; additional features in the Tiny MCE editor (the excellent page editor built into WordPress). </li>
</ul>
<p>WordPress also has the ability to install &#8220;themes&#8221; that change the appearance of your site with just a click of the button.  AND there are hundreds, if not thousands, of themes that have been contributed by the community.  You can browse through themes <a href="http://themes.wordpress.net">here</a>.</p>
<p>If you&#8217;re looking for free open source software to run your website, you can&#8217;t go wrong with WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.innovativesys.net/?feed=rss2&#038;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
