Invalid datatype specified: Npgsql.NpgsqlConnection

Posted by jmls on 27-Nov-2012 00:23

progress 11.1

this sometimes bites me, and I can never remember why. So, I'm making my ignorance public in order to be able so search for the problem and solution when it next happens

I have a project in OEA/PDS that uses a standard assemblies setup, and have a dll called Npgsql.dll in the root of my project folder

I have added the dll to the assemblies reference, and can browse the assembly reference

the code completion in OEA finds the dll, and makes all the appropriate suggestions

*but*

despite the code completion completing the line

def var conn as Npgsql.NpgsqlConnection no-undo.

I still get a syntax error

 Invalid datatype specified: Npgsql.NpgsqlConnection

when I type Npgsql. the NpgsqlConnection is suggested !

so, for the public record , and public humiliation, what am I doing wrong ?

All Replies

Posted by jmls on 27-Nov-2012 00:28

of course, the second I post, I see a potential problem

in the class browser, I see

"Npgsql.NpgsqlConnection cannot be instantiated as it has private constructors"

however, the c# code that accompanies the dll is thus

NpgsqlConnection conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=joe;Password=secret;Database=joedata;");

so, if c# can do it, what's the magic trick for Progress ?

Posted by Peter Judge on 27-Nov-2012 07:55

jmls wrote:

of course, the second I post, I see a potential problem

in the class browser, I see

"Npgsql.NpgsqlConnection cannot be instantiated as it has private constructors"

however, the c# code that accompanies the dll is thus

NpgsqlConnection conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=joe;Password=secret;Database=joedata;");



so, if c# can do it, what's the magic trick for Progress ?


This code compile for me, with a newly-downloaded  Npgsql2.0.12. I haven't tried running it because I don't have Postgres installed (don't actually know why I'm responding, given that you do )

def var conn as Npgsql.NpgsqlConnection no-undo.

conn = new Npgsql.NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=joe;Password=secret;Database=joedata;").

Note: running  OE 11.1 and I downloaded the .NET 4.0 version.

There's something else wrong.

-- peter

Posted by Admin on 27-Nov-2012 11:21

jmls wrote:

 Invalid datatype specified: Npgsql.NpgsqlConnection


when I type Npgsql. the NpgsqlConnection is suggested !



so, for the public record , and public humiliation, what am I doing wrong ?


Well, if it's for a good cause like public humiliation I do have an almost exact scenario but on 10.2B with MS Exchange Web Service (EWS) managed API... have a case with technical support on this but don't expect to get any where with it. I can use all classes in that damn assembly but the ExchangeService one, alas one can't do nothing without that class

Posted by Peter Judge on 27-Nov-2012 12:12

Marian,

Tangentially related, Bruce Gruenbaum did some integration with Exchange Web services, that he documented at http://www.thesoftwaregorilla.com/2010/07/exchange-web-services-example-part-4-subscriptions-and-notifications/ . Maybe this can help?

-- peter

Posted by Admin on 27-Nov-2012 12:25

Thanks Peter, what Bruce did back then does look impressive but as we can now use .NOT assemblies directly from ABL I would not go that route no matter how much I like Java... I'm way to lazy for doing all that
I'll try tomorrow again to get Managed API to work (http://msdn.microsoft.com/en-us/library/exchange/dd633709(v=exchg.80).aspx), it does work on my local installation of 10.2B as well as in 11.1 but the client runs on Citrix and sadly is there where this need to work
argh... Julian really deserve to be punished for even trying to connect to postgresql, what he was thinking?

Posted by Peter Judge on 27-Nov-2012 12:37

Ah, OK. I'd not read the article again because I remembered (or thought I did) that he used .NET for this stuff. I should learn to read again

I could have sworn it was .NET ...

-- peter

Posted by jmls on 29-Nov-2012 00:21

marianedu wrote:

Julian really deserve to be punished for even trying to connect to postgresql, what he was thinking?

Oi! When progress can run on a raspberry Pi, then we can talk punishment

Posted by jmls on 29-Nov-2012 00:23

Ok, so that I can get it working like what you have (!) would you be able to say step by step how / where you installed the dll ?

I just don't get how it appears in the class browser just fine but does not compile. Other parts do (like Npgsql.Keywords) so it looks like part of the dll registered, but not all ?

What version of progress are you using ? Patch level ?

I'm on 11.1 vanilla

Thanks for the help

Posted by jmls on 29-Nov-2012 00:39

Ok, interesting. It's working now.

I downloaded the .net3.5 version (I was using the 4.0)

also copied in the monosecurity and policy2.0 dlls as well (just in case)

Unblocked all the files (right-mouse click each one, unblock)

added assembly using the local assemblies tab

very odd. But thanks

Posted by jmls on 29-Nov-2012 00:40

getting old, mate.

Posted by Marian Edu on 29-Nov-2012 00:43

damn sir, you're always ahead

just closed my case on TS as it turn out the .NOT version matters... tried to wrap the damn class in my own C# and found out there was only 4.0 installed while 10.2B works with 3.5, once I had them install 3.5 on that computer it works just fine from ABL, weird though... no error as it can't load the asembly but only see parts of it's content

Posted by Marian Edu on 29-Nov-2012 00:45

I could have sworn it was .NET ...

-- peter

indeed, it's .NOT... argh, .NOT... hmm, might be the keyboard but the closest I can get is Mono

Posted by jmls on 29-Nov-2012 00:47

yeah, but for my case 11.1 is meant to support .net 4.0

Posted by jmls on 29-Nov-2012 00:47

lol

This thread is closed