Mar 10, 2011

Visual Studio 2010: Displaying Assembly in “Add Reference” Dialog Box

When you add .net assemblies to the GAC, it is not true they will show in “Add reference” dialog in Visual Studio IDE.

I found http://support.microsoft.com/kb/306149 link which describe the steps that we want to follow.

But, it is not working for VS2010. To work with need to set following Reg Key path.

 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\MyAssembly\
(Default)= “Assembly Folder path”

Feb 15, 2011

Connecting DB2/iSeries From .net Application

I need to connect to a DB2 from a .net application. But it’s  in iSeries system. I did not know what is the way do it. I read lot of articles/blog posts and really helped me. But in this post, I thought to consolidate them for fast reference.

There are two .net data providers for DB2.

  1. IBM.Data.DB2.iSeries
  2. IBM.Data.DB2

Both provider follows same rules/guidelines of common ADO.net components. For an example, both have Connection, Command, DataAdapter, DataReader. But there are differences and limitations.

IBM.Data.DB2.iSeries

Using this provider you can only access to iSeries system. You have to install iSeries Client Access to development machine and/or server. It is quite a bit setup file ( > 3GB with 64Bit version), but we required (refer the bellow screen shots)

  • .NET Data Provider
  • Header,Library and Documentation.

clip_image002Figure 1clip_image002[12]

 

There are limitations/unsupported features [IBM Redbooks 2005 ,Page 38]  in this provider, bellow lists 3 out of 11.

  1. User-defined types (UDTs): Although some features may work, extensive testing has not
    been done using the IBM.Data.DB2.iSeries provider with UDTs.
  2. Distributed relational database architecture (DRDA®), including the CONNECT and
    DISCONNECT statements.
  3. SET TRANSACTION, COMMIT, and ROLLBACK statements: Instead, we recommend
    using the built-in transaction support provided via the iDB2Connection.BeginTransaction()
    method, and the iDB2Transaction object.

I think they have stopped update/improvements for this provider after .net version 1.1

IBM.Data.DB2

This comes as new IBM  data provider for .net 2.0 and having rich features. For the easier development, it is coming with Visual Studio Add-in. Also IBM released beta version for .net 4.0 and add-in for VS 2010. You can see details and download by clicking this link.

Testing DB2 .net connection

After installing either IBM Data Server Client or IBM Data Server Runtime Client, we can test the connection by running following command,

To connect iSeries system, we have to give the port no 446 (default) to the connection string, Server=[IP:PORT].

C:\Program Files\IBM\SQLLIB\BIN>testconn20.exe "User ID=[UserName];Password=[pwd];
Database=[Data Base Or Alias];Server=[IP];"

If this success, it should dump output to the console similar to the following.[Beginning DB2 2008, Page 282]



Step 1:Printing version info
    .NET Framework version: 2.0.50727.42
    DB2 .NET provider version: 9.0.0.2
    Capability bits: ALLDEFINED
    Build: 20070524
    Factory for invairant name IBM.Data.DB2 verified
    Elapsed: 7.15625
 
Step 2: Connecting using "User ID=fuzzy;Password=fuzzy;Database=SAMPLE;
    Server=localhost;ServerType=db2;pooling=false"
    Server type and version: DB2/NT 09.05.0000
    Elapsed: 4.640625
 
Step 3: Selecting rows from SYSIBM.SYSTABLES to validate existence of packages
    SELECT * FROM SYSIBM.SYSTABLES FETCH FIRST 5 rows only
    Elapsed: 0.890625
 
Step 4: Calling GetSchema for tables to validate existence of schema functions
    Elapsed: 1.78125
 
Test passed.




References


[IBM Redbooks 2005]:  Hernando Bedoya,Carlos Carminati,Lorie DuBois,Jarek Miszczyk,Ajit Mungale. Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET. 2005


[Beginning DB2 2008]: Grant Allen,Beginning DB2: From Novice to Professional, Apress 2008

Feb 11, 2011

Visual Studio Add-Ins not showing in the “Tool” menu

For my developments, I am using VS 2005, VS 2008 and VS 2010 side  by side. I have developed couple of Add-ins (XML Add-Ins) for my own use to ease the development, one can be found in this blog.

Last week I installed DB2 connection tool kit( for testing purposes) which installed a VS Add-in (COM Add-in) too. I removed that product from my system, it also removing the Add-ins. My other Add-ins also gone from the “Tool” menu (This happened only to VS 2005 & 2008).

But in Add-In Manger I can see them,

VS Add-In Manger

What I did?

I found lots of tips from the Net. All are talking about Registry Entries and devenv command.

  1. running
    devenv /setup


    failed.


  2. Changing

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\PreloadAddinStateManaged
    <MyAddIn Name> value

    value 2 to 1 failed.
  3. running
    devenv.exe /resetaddin [Namespace].Class

    worked. This wont delete any Add-ins from the disk. You have to re-load them from the Add-ins Manger.

 


References



  1. Visual Studio Forums
  2. MZ-Tools

Feb 2, 2011

Creating MS SharePoint meeting workspace from MS Outlook 2010

Microsoft SharePoint is tremendous collaboration tool for an organization.  As a software engineer I’m using SharePoint to manage my team, their activities, event customers requirements.

In SharePoint, we can manage meeting workspace where we can store relevant documents, agenda, decisions etc. All attendees can share them, hence it is easy to use for later references.

Here is the simple steps to create meeting workspace from Outlook 2010.

  1. Adding “Meeting Workspace” icon image to the Quick Access tool bar of Meeting window.
    • Go to “Calendar”
    • File-> Option & follow the numbered
      image
  2. Setup the meeting request as usually.
    • Click on “Meeting Workspace” icon
    • Now you can see a panel named “Meeting Workspace” on the right hand side of Meeting request window.
    • There,
      Select a Location.
      Select a type of Meeting workspace. Eg. Basic Meeting Workspace, Blank Meeting Workspace etc.
    • Click on “Link” button and it will embed to meeting workspace link to the email body.
      image

Security


By Default, all invited associates will be granted to read, write and delete information in the workspace.

Jan 20, 2011

Movex Class Builder v2.0

I released Movex Class Builder v 2.0 after 2+ yrs from its initial release.

New Features:

  1. It is showing connected IP and Port. You can change the setting and re-connect the same time. No need to close-and-reopen the Class Builder.

     image5
  2. Checking API Layout.
    This enable us to check consistency in C# class API layout and current Movex API layout.

    image10 

    By clicking on this option, it will search currently connected API is in opened project, it does show the summary dialog box.

    image
    Figure: C# Class and M3 API layout is exactly matched.

    image
    Figure: Having conflicts in the code

Dec 22, 2010

RANK() and alternate Sub Query in T-SQL

Consider, we have data table called Orders_Header which hold order header details.
Table
As you can see, PO number(PONo)  ‘0050426995’ is duplicating. Because this table containing PO amendments too. If you notice, DownloadData is in order, meaning first version of PO received on 2010-06-26 17:07:04.910, rest of them subsequently.
The requirement is we want to get following output.
output
Normally we can write a sub query for this and get the output.
SELECT PONo,
(
SELECT COUNT(PONo)+1 -- to omit zero
FROM ORDERS_Header WHERE PONo=oh.PONo AND DownloadDate< oh.DownloadDate
) AS Revision,
DownloadDate
FROM ORDERS_Header oh
ORDER BY PONO,DownloadDate

By running this query, you can see the following Actual Execution Plan.

Sub_plan



From MS-SQL 2005 onwards this can be easily achieved by RANK() function. 


SElECT PONo, 
RANK() OVER(PARTITION BY PONo ORDER BY DownloadDate) AS Revision ,DownloadDate 
FROM dbo.ORDERS_Header
ORDER BY PONO,DownloadDate



Check its Actual Execution Plan and note the difference.

Rank_plan

Dec 1, 2010

Movex Tech Training from Lawson

My current employer (Brandix Lanka) arranged a MoveX technical training from Lawson, our ERP vendor. It took 12 days and today is the last day.

Mr. Daniel Rodrigo Olea , EMEA Technical Project Manager of Lawson software is the presenter and delivered marvelous sessions to our team. Daniel Rodrigo Olea

Very first day, we were totally blank of what he is talking about. But he guided us in a way that we were able to understand almost everything in Movex code.

         

 

 

Areas that we covered in the training,

  1. MAK tool
  2. Creating/modifying Movex Program
  3. Creating/modifying View Definition
  4. Creating/modifying M3 API
  5. Managing Out Interface
  6. Data tables, Data Structures, CL in M3
  7. Lawson web services to interact with M3 programs and APIs.
  8. and much more…

MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...