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: .net data provider, C#, db2 .net data provider, SQL
8 Comments:
I searched you posts and they are useful. Have done or seen anything about .Net and Data Queues on the iSeries?
Trying to get in touch with a certain Colm Bryne I worked with in San Francisco, summer 2000.
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.
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
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 >
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
Here is everything you need to know about the facetime application
download facetime for android
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