开发者

C# Connecting to iSeries

开发者 https://www.devze.com 2023-03-18 02:41 出处:网络
I am a iSeries Veteran who is expanding into the .Net world usingC# and ASP.Net.I have Client Access loaded on my computer and I have added the IBM.Data.DB2.iSeries.dll as a reference.I have also adde

I am a iSeries Veteran who is expanding into the .Net world using C# and ASP.Net. I have Client Access loaded on my computer and I have added the IBM.Data.DB2.iSeries.dll as a reference.I have also added the .dll to my toolbox.

I cannot use any of the开发者_开发百科 iDB2 stuff in my ASP.NET for connecting to the iSeries, as I get this error:

"The type or namespace Db2Connection could not be found (are you missing a using directive or assembly reference)." I have the IBM.Data.DB2.iSeries.dll added as a reference.

How can this be solved?

  • Windows 7 Ultimate x64
  • Visual Studio 2010 SP1
  • .Net Framework 4.0
  • Client Access V6R1


Unfortunately the IBM.Data.DB2.iSeries library has many dependencies in your client access installation. It will definitely won't work by itself and it is a pain to deploy. You mentioned that you have client access installed. Sometimes, not all the libraries are installed for programmatic data access. Use your disk and make sure to reinstall the ".NET Data Provider" under the "Data Access" section of the installer.

Also, make sure you are running the latest IBM iSeries Service Pack. In your case, for V6R1, it is SI42423 at the time of this writing. You can login anonymously @ this ftp address and install the 32 or 64 bit version as needed.

Lastly, problem might also be related to your connection string. In your web.config your connection string should look like this:

<add name="AS400Connection" connectionString="DataSource=10.0.0.1;ConnectionTimeout=60;UserID=username;Password=password" providerName="IBM.Data.DB2.iSeries" />

Good Luck!


Do you have using IBM.Data.DB2.iSeries in your code-behind (the .cs file)?


You need to use iDB2Connection. The DB2Connection class is used by DB2 LUW.

0

精彩评论

暂无评论...
验证码 换一张
取 消