I created a local directory and moved my project there and now all
three connections work.
Yup. One of the .net security permissions has to do with running
assemblies that are located on a remote machine. Your network share
would have been a "remote" machine so you would have needed to request
that permission, as I don't believe it's assigned by default.
Glad it's working now.
As for the other part of your question. I think it's evolutionary, but
eventually you'll end up writing business objects to encapsulate the
database IO and having your UI code not deal w/the System i at all. I
find the connectors and shortcuts to be nice fluff, but as you build
more complex apps you'll start to ignore them and roll your own code.
I'd suggest the MS Data Block, but unfortunately you can't use the IBM
provider with them. I understand that's fixed in the V6R1 provider, if
you have access to that then check out the data blocks. I'd even go a
step further and write your own wrapper around the blocks. One thing
we've done is encapsulate the retrieval of the connection string.
99.9999% of the time you'll be using the same connection string. Why
should you have to retrieve it over and over and pass it around all the
time. You're always going to get it from the .config file, so why not
let the datablocks do that.
-Walden
As an Amazon Associate we earn from qualifying purchases.