<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>Continuum Drift - Storis</title>
    <link>http://www.continuumconcepts.com/Blog/</link>
    <description>Continuum Concepts Dev Log</description>
    <language>en-us</language>
    <copyright>Continuum Concepts, LLC</copyright>
    <lastBuildDate>Sun, 08 Mar 2009 17:25:23 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>chris@continuumconcepts.com</managingEditor>
    <webMaster>chris@continuumconcepts.com</webMaster>
    <item>
      <trackback:ping>http://www.continuumconcepts.com/Blog/Trackback.aspx?guid=f74960fe-454e-4e6f-af8b-ff9f16826108</trackback:ping>
      <pingback:server>http://www.continuumconcepts.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.continuumconcepts.com/Blog/PermaLink,guid,f74960fe-454e-4e6f-af8b-ff9f16826108.aspx</pingback:target>
      <dc:creator>Chris</dc:creator>
      <wfw:comment>http://www.continuumconcepts.com/Blog/CommentView,guid,f74960fe-454e-4e6f-af8b-ff9f16826108.aspx</wfw:comment>
      <wfw:commentRss>http://www.continuumconcepts.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f74960fe-454e-4e6f-af8b-ff9f16826108</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I have a client that uses <a href="http://www.storis.com/">Storis</a> as
his point-of-sale system. We've got a C#/ASP.NET app running on their intranet that
monitors and reports on some other systems, and we wanted to add Storis to the mix.
Storis uses IBM UniData as its back end, so this is where we started.<br /><br />
One of the things we got from Storis was a UniData Client CD, which includes an Admin,
the UniDK, UniData ODBC, VSG, UniTools, and Dynamic Connect. Included in the UniDK
are an OLEDB driver and UniObjects.NET. You might think that UniObjects.NET was the
thing to use but that is not what we discovered. We WERE able to pull data out of
Storis with UniObjects.NET, but the data was in its native form and SQL was not available.
We had to do weird stuff, like query a table for its keys, get them in an array, and
then query the table again by its keys. You couldn't just pull back data where Date
&gt;= '2009-03-08', for example. At least in no way that was apparent to us.<br /><br />
We installed all that stuff, but it turns out not all of it is necessary. We ended
up only using the ODBC driver and VSG.<br /><br />
How we did it:<br /><ol><li>
Install the ODBC Driver</li><li>
Edit the C:\IBM\UniDK\Config\uci.config file, adding this to the bottom:<br />
&lt;storis&gt;<br />
DBMSTYPE = UNIDATA<br />
network = TCP/IP<br />
service = udserver<br />
host = <i>[your storis IP address]</i></li><li>
Add an ODBC System DSN</li></ol><ol><li>
Click Administrative Tools - Data Sources. Note that on a 64-bit system, you will
need to access the 32-bit ODBC applet, which you can get to (on Vista x64, for example)
in Control Panel -&gt; View 32-Bit Control Panel Items</li><li>
On the System DSN Tab, Click Add...</li><li>
Select the IBM UniData ODBC Driver</li><li>
Click Finish</li></ol><li>
Configure the DSN</li><ol><li>
Select your DSN from the list</li><li>
Click Configure...</li><li>
Give it a Data Source Name. We went with "StorisUnidata"</li><li>
For the server, specify "storis", which is the first line you added to the uci.config
file above.</li><li>
Specify your Database name. In the UniData world, they often refer to this as the
Account Name, which is a little confusing.</li><li>
For the User, specify a windows account that can access your database. To eliminate
permissions issues, we started with a local system administrator account. We entered
that account name under User.</li><li>
Click OK.</li></ol><li>
Before you can access your data with SQL, you need to use the Visual Schema Generator
to create a SQL Mapping:</li><ol><li>
Prepare yourself, because this app is a bit ugly :). Think Lotus Notes...<br /></li><li>
Launch the VSG</li><li>
This is just like configuring the DSN:<br /></li></ol><ol><li>
For the server, specify "storis", which is the first line you added to the uci.config
file above.</li><li>
Specify your Database name. In the UniData world, they often refer to this as the
Account Name, which is a little confusing.</li><li>
For the User, specify a windows account that can access your database. To eliminate
permissions issues, we started with a local system administrator account. We entered
that account name under User.</li><li>
Enter the password for that windows account.<br /></li><li>
Click OK.</li></ol><li>
Click List on the Main Menu, to see all your tables.</li><li>
Select a table, such as SALES.FLASH.DAILY<br /></li><li>
Click Open. Note that the dots are illegal in SQL table names, so they will be changed
to underscores.</li><li>
It was not necessary for us to configure any privileges. Possibly because the account
was an admin. You may wish to try an Administrator account first as well, then come
back here to refine the permissions after you have it working.</li><li>
Click Map Attributes</li><li>
Click the columns you want, and hit Add. You may be prompted to rename your column,
swapping out illegal characters with underscores.</li><li>
Click OK.</li><li>
Click Close.</li><li>
Hit List on the Main Menu and you should see your SQL Table listed in the right column.</li><li>
You can exit VSG.<br /></li><li>
At this point, you should be able to access data in your Storis database via ODBC.
So if you're an Access user, you're just about done. You can create a linked table
in your usual way, specifying this DSN for your connection information. For .NET programmers,
continue:<br /></li><li>
Your ConnectionString will look something like this: &lt;add key="StorisSystemDsn"
value="dsn=StorisUnidata;srv=storis;dbq=YourDatabaseName;uid=YourUserName;pwd=YourPassword;"
/&gt;</li><li>
If you're using the Enterprise Library Data Access Application Block (DAAB), your
connection string will look more like: &lt;add name="StorisOdbc" connectionString="dsn=StorisUnidata;srv=storis;dbq=YourDatabaseName;uid=YourUserName;pwd=YourPassword;"
providerName="System.Data.Odbc" /&gt;</li><li>
You're ready to code!</li><li>
If your server is 64-bit, your app will not be able to load the 32-bit ODBC driver,
and as far as I know, no 64-bit one is available. To get it working in IIS7 on a 64-bit
box:</li><ol><li>
Create a new application pool, and call it something like StorisApp32</li><li>
In its Advanced Settings, Set Enable 32-Bit Applications to True.</li><li>
Set your app to use this application pool.</li><li>
It will now run in 32-bit mode and load the ODBC driver.</li><li>
You do not have to change the way you compile (no need to specify x86 only, or anything
like that).<br /></li></ol>
Grab some data and bind it to a GridView called gvRecords like this:<br /><pre><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">OdbcConnection
odbcConnection <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">new</span> OdbcConnection(ConfigurationManager.AppSettings[<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"StorisSystemDsn"</span>]);
OdbcDataAdapter odbcDataAdapter <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">new</span> OdbcDataAdapter(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"select
* from from SALES_FLASH_DAILY"</span>, odbcConnection); DataSet dataSet <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;">new</span> DataSet();
odbcDataAdapter.Fill(dataSet); gvRecords.DataSource <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> dataSet.Tables[0];
gvRecords.DataBind();</span></pre>If using the Enterprise Library, try this:<br /><pre><span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;">Database
db <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> DatabaseFactory.CreateDatabase(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"StorisOdbc"</span>);
DbCommand dbCommand <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> db.GetSqlStringCommand(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"select
* from from SALES_FLASH_DAILY"</span>); DataSet dataSet <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> db.ExecuteDataSet(dbCommand);
gvRecords.DataSource <span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;">=</span> dataSet.Tables[0];
gvRecords.DataBind(); </span></pre>That worked for us, and I hope it works for you!<br /><br />
Notes: I was not able to get the OLEDB Driver to work. I kept getting errors about
the provider name not being correct. I tried different provider names, even using
a script to get the exact name registered with the system, but to no avail. If you
get it working, please leave a comment with some instructions :)<br /><p></p><img width="0" height="0" src="http://www.continuumconcepts.com/Blog/aggbug.ashx?id=f74960fe-454e-4e6f-af8b-ff9f16826108" /></body>
      <title>How To Get Storis / UniData Data From a C# .Net Application (or just about anything) via ODBC in Windows</title>
      <guid isPermaLink="false">http://www.continuumconcepts.com/Blog/PermaLink,guid,f74960fe-454e-4e6f-af8b-ff9f16826108.aspx</guid>
      <link>http://www.continuumconcepts.com/Blog/2009/03/08/HowToGetStorisUniDataDataFromACNetApplicationOrJustAboutAnythingViaODBCInWindows.aspx</link>
      <pubDate>Sun, 08 Mar 2009 17:25:23 GMT</pubDate>
      <description>I have a client that uses &lt;a href="http://www.storis.com/"&gt;Storis&lt;/a&gt; as his point-of-sale
system. We've got a C#/ASP.NET app running on their intranet that monitors and reports
on some other systems, and we wanted to add Storis to the mix. Storis uses IBM UniData
as its back end, so this is where we started.&lt;br&gt;
&lt;br&gt;
One of the things we got from Storis was a UniData Client CD, which includes an Admin,
the UniDK, UniData ODBC, VSG, UniTools, and Dynamic Connect. Included in the UniDK
are an OLEDB driver and UniObjects.NET. You might think that UniObjects.NET was the
thing to use but that is not what we discovered. We WERE able to pull data out of
Storis with UniObjects.NET, but the data was in its native form and SQL was not available.
We had to do weird stuff, like query a table for its keys, get them in an array, and
then query the table again by its keys. You couldn't just pull back data where Date
&amp;gt;= '2009-03-08', for example. At least in no way that was apparent to us.&lt;br&gt;
&lt;br&gt;
We installed all that stuff, but it turns out not all of it is necessary. We ended
up only using the ODBC driver and VSG.&lt;br&gt;
&lt;br&gt;
How we did it:&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Install the ODBC Driver&lt;/li&gt;
&lt;li&gt;
Edit the C:\IBM\UniDK\Config\uci.config file, adding this to the bottom:&lt;br&gt;
&amp;lt;storis&amp;gt;&lt;br&gt;
DBMSTYPE = UNIDATA&lt;br&gt;
network = TCP/IP&lt;br&gt;
service = udserver&lt;br&gt;
host = &lt;i&gt;[your storis IP address]&lt;/i&gt;
&lt;/li&gt;
&lt;li&gt;
Add an ODBC System DSN&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Click Administrative Tools - Data Sources. Note that on a 64-bit system, you will
need to access the 32-bit ODBC applet, which you can get to (on Vista x64, for example)
in Control Panel -&amp;gt; View 32-Bit Control Panel Items&lt;/li&gt;
&lt;li&gt;
On the System DSN Tab, Click Add...&lt;/li&gt;
&lt;li&gt;
Select the IBM UniData ODBC Driver&lt;/li&gt;
&lt;li&gt;
Click Finish&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Configure the DSN&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Select your DSN from the list&lt;/li&gt;
&lt;li&gt;
Click Configure...&lt;/li&gt;
&lt;li&gt;
Give it a Data Source Name. We went with "StorisUnidata"&lt;/li&gt;
&lt;li&gt;
For the server, specify "storis", which is the first line you added to the uci.config
file above.&lt;/li&gt;
&lt;li&gt;
Specify your Database name. In the UniData world, they often refer to this as the
Account Name, which is a little confusing.&lt;/li&gt;
&lt;li&gt;
For the User, specify a windows account that can access your database. To eliminate
permissions issues, we started with a local system administrator account. We entered
that account name under User.&lt;/li&gt;
&lt;li&gt;
Click OK.&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Before you can access your data with SQL, you need to use the Visual Schema Generator
to create a SQL Mapping:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Prepare yourself, because this app is a bit ugly :). Think Lotus Notes...&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Launch the VSG&lt;/li&gt;
&lt;li&gt;
This is just like configuring the DSN:&lt;br&gt;
&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
For the server, specify "storis", which is the first line you added to the uci.config
file above.&lt;/li&gt;
&lt;li&gt;
Specify your Database name. In the UniData world, they often refer to this as the
Account Name, which is a little confusing.&lt;/li&gt;
&lt;li&gt;
For the User, specify a windows account that can access your database. To eliminate
permissions issues, we started with a local system administrator account. We entered
that account name under User.&lt;/li&gt;
&lt;li&gt;
Enter the password for that windows account.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Click OK.&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Click List on the Main Menu, to see all your tables.&lt;/li&gt;
&lt;li&gt;
Select a table, such as SALES.FLASH.DAILY&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Click Open. Note that the dots are illegal in SQL table names, so they will be changed
to underscores.&lt;/li&gt;
&lt;li&gt;
It was not necessary for us to configure any privileges. Possibly because the account
was an admin. You may wish to try an Administrator account first as well, then come
back here to refine the permissions after you have it working.&lt;/li&gt;
&lt;li&gt;
Click Map Attributes&lt;/li&gt;
&lt;li&gt;
Click the columns you want, and hit Add. You may be prompted to rename your column,
swapping out illegal characters with underscores.&lt;/li&gt;
&lt;li&gt;
Click OK.&lt;/li&gt;
&lt;li&gt;
Click Close.&lt;/li&gt;
&lt;li&gt;
Hit List on the Main Menu and you should see your SQL Table listed in the right column.&lt;/li&gt;
&lt;li&gt;
You can exit VSG.&lt;br&gt;
&lt;/li&gt;&gt;
&lt;li&gt;
At this point, you should be able to access data in your Storis database via ODBC.
So if you're an Access user, you're just about done. You can create a linked table
in your usual way, specifying this DSN for your connection information. For .NET programmers,
continue:&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Your ConnectionString will look something like this: &amp;lt;add key="StorisSystemDsn"
value="dsn=StorisUnidata;srv=storis;dbq=YourDatabaseName;uid=YourUserName;pwd=YourPassword;"
/&amp;gt;&lt;/li&gt;
&lt;li&gt;
If you're using the Enterprise Library Data Access Application Block (DAAB), your
connection string will look more like: &amp;lt;add name="StorisOdbc" connectionString="dsn=StorisUnidata;srv=storis;dbq=YourDatabaseName;uid=YourUserName;pwd=YourPassword;"
providerName="System.Data.Odbc" /&amp;gt;&lt;/li&gt;
&lt;li&gt;
You're ready to code!&lt;/li&gt;
&lt;li&gt;
If your server is 64-bit, your app will not be able to load the 32-bit ODBC driver,
and as far as I know, no 64-bit one is available. To get it working in IIS7 on a 64-bit
box:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Create a new application pool, and call it something like StorisApp32&lt;/li&gt;
&lt;li&gt;
In its Advanced Settings, Set Enable 32-Bit Applications to True.&lt;/li&gt;
&lt;li&gt;
Set your app to use this application pool.&lt;/li&gt;
&lt;li&gt;
It will now run in 32-bit mode and load the ODBC driver.&lt;/li&gt;
&lt;li&gt;
You do not have to change the way you compile (no need to specify x86 only, or anything
like that).&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&gt;
Grab some data and bind it to a GridView called gvRecords like this:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;OdbcConnection
odbcConnection &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; OdbcConnection(ConfigurationManager.AppSettings[&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"StorisSystemDsn"&lt;/span&gt;]);
OdbcDataAdapter odbcDataAdapter &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; OdbcDataAdapter(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"select
* from from SALES_FLASH_DAILY"&lt;/span&gt;, odbcConnection); DataSet dataSet &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; DataSet();
odbcDataAdapter.Fill(dataSet); gvRecords.DataSource &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; dataSet.Tables[0];
gvRecords.DataBind();&lt;/span&gt;&lt;/pre&gt;If using the Enterprise Library, try this:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;Database
db &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; DatabaseFactory.CreateDatabase(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"StorisOdbc"&lt;/span&gt;);
DbCommand dbCommand &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; db.GetSqlStringCommand(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"select
* from from SALES_FLASH_DAILY"&lt;/span&gt;); DataSet dataSet &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; db.ExecuteDataSet(dbCommand);
gvRecords.DataSource &lt;span style="color: Red; background-color: transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; dataSet.Tables[0];
gvRecords.DataBind(); &lt;/span&gt;&lt;/pre&gt;That worked for us, and I hope it works for you!&lt;br&gt;
&lt;br&gt;
Notes: I was not able to get the OLEDB Driver to work. I kept getting errors about
the provider name not being correct. I tried different provider names, even using
a script to get the exact name registered with the system, but to no avail. If you
get it working, please leave a comment with some instructions :)&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.continuumconcepts.com/Blog/aggbug.ashx?id=f74960fe-454e-4e6f-af8b-ff9f16826108" /&gt;</description>
      <comments>http://www.continuumconcepts.com/Blog/CommentView,guid,f74960fe-454e-4e6f-af8b-ff9f16826108.aspx</comments>
      <category>Development</category>
      <category>Storis</category>
      <category>UniData</category>
    </item>
  </channel>
</rss>