Dot Net Fluke: Getting by on C# for iSeries RPG Developers

Useful tutorials on C# and .NET for RPG iSeries AS/400 developers. Brought to you from the folks at AranRock Consulting

3/19/10

Connection String Stinger - Phantom Library List

.Net can look for your tables in a library the same name as your user id  even if you supply a library list. This can cause your SQL 'selects' to fail.
Take a look:
Here's a basic connection string using the IBM supplied iDB2 Classes:
DataSource=192.168.0.1; UserID=colm;Password=xxxx;LibraryList= CusLib,ARlib, QGPL

At first glance everything looks good, right?
So now I want to get at my table MYCUST in CusLib. Should be a no brainer. However if I run the SQL command 'Select * from MYCUST' guess what I get?  - A big fat error like this:
SQL0204 - File MYCSUT in COLM not found
What??. CusLib is on the TOP - I don't even mention library Colm.  What's going on?
IBM says that if you are using the SQL naming convention that it sets the default collection or library to the library with the same name as the user id. I have no idea why they do this! Anyway if you have this issue the simple fix is to specify the default collection. i.e. defaultcollection=cuslib
Here's the new connection string
DataSource=192.168.0.1; UserID=colm;Password=xxxx;LibraryList= CusLib,ARlib, QGPL;DefaultCollection=CUSLIB

Labels: , , ,

8 Comments:

At November 13, 2008 at 2:40 PM , Blogger miathet said...

I searched you posts and they are useful. Have done or seen anything about .Net and Data Queues on the iSeries?

 
At December 18, 2008 at 7:29 PM , Blogger MA Shumin (馬淑敏) said...

Trying to get in touch with a certain Colm Bryne I worked with in San Francisco, summer 2000.

 
At April 1, 2010 at 10:23 AM , Blogger Shawn said...

I think this is getting me on the right track but I am still getting the error File Not Found. The SP is in my Test Library (Shawnr) and my connection string and VB Code is below. Maybe you will see something wrong here.

Using o As New IBM.Data.DB2.iSeries.iDB2Connection("DataSource=xxx.xx.xxx.xxx;UserID=xx;Password=xx;LibraryList=HS4TEST;DefaultCollection=HS4TEST;")
o.Open()
Dim myCommand As New IBM.Data.DB2.iSeries.iDB2Command("Shawnr.GetList", o)
myCommand.CommandType = CommandType.StoredProcedure
Using myReader As IBM.Data.DB2.iSeries.iDB2DataReader = myCommand.ExecuteReader()
If myReader.Read Then MessageBox.Show("Working")
End Using
End Using


Do I need to have my SP in my actual data libary, this is not something we want to do.

 
At October 6, 2015 at 5:29 AM , Blogger Unknown said...


Nice post. We appreciate that. Given that ASP.NET is interested in many years, there are numerous developers that are expert at utilizing it to develop the best of apps. Establishing an application in Dot net training in Chennai with the assistance of this systems fairly cost-effective. The easy energy for this will allow the creators to perform the granted occupation inside the stipulated time period. And this also permits supply of quality products and services in dot net platform.Take a look to my blog Dot Net Training Academy in Chennai

 
At December 29, 2015 at 1:35 AM , Blogger wdmtest said...

Improving Client-Side Performance
Understanding Web Caching
Content Delivery Networks
Optimizing Internet Explorer JavaScript Performance
Reducing the Web Service Call Payload
Loading the UI on Demand
Using Read-Ahead Caching for Ajax Calls
Hiding HTML Inside < text area >

 
At June 27, 2017 at 4:29 AM , Blogger kingrani said...

Flipkart is Offering Cashback Offers Flipkart YES Cashback Offer You will get upto 75% Discount

Flipkart is Offering Cashback Offers Flipkart Phonepe Cashback Offer You will get upto 75% Discount

Flipkart is Offering Cashback Offers Flipkart Cashback Offer You will get upto 75% Discount

Flipkart is one of the biggest world wide eCommerce Site flipkart cashback offersso

Flipkart is one of the biggest world wide eCommerce Site Flipkart hdfc offersso


 
At August 8, 2017 at 2:54 AM , Anonymous Anonymous said...

Here is everything you need to know about the facetime application
download facetime for android

 
At February 3, 2022 at 8:50 AM , Anonymous Anonymous said...

Baccarat | Online Casino | Real Money - FBCasino
Baccarat is one of the easiest games that you can play at the online casino. It is considered very similar to traditional 바카라 신규 가입 쿠폰 betting. It has a total of 3

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home