×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Npgsql 1.0.0.0

Npgsql 1.0.0.0

Npgsql 1.0.0.0

(OP)
Hi all, could you please help me?
I am doing program in C# and my WebService could not access the  Postgre Database. I hade just one another program which used Npgsql version 7.0.0 and now I have 1.0.0.0 and dont know why it cant work. The method NpgsqlConnection.Open() doesnt work.
I gave following exception:

System.Exception: Error by inserting new record  into 'DeliveryInfo' log table. ---> Npgsql.NpgsqlException: The attempted operation is not supported for the type of object referenced ---> System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced
   at System.Net.Sockets.Socket.get_ConnectEx()
   at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
   at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
   at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context)
   --- End of inner exception stack trace ---
   at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context)
   at Npgsql.NpgsqlConnector.Open()
   at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
   at Npgsql.NpgsqlConnectorPool.RequestPooledConnectorInternal(NpgsqlConnection Connection)
   at Npgsql.NpgsqlConnectorPool.RequestPooledConnector(NpgsqlConnection Connection)
   at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection)
   at Npgsql.NpgsqlConnection.Open()
   at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.Open() in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 255
   at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.CreateCommand(String sProcName, NpgsqlParameter[] collInputParams) in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 219
   at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.RunCommonProcedure(String sProcName, NpgsqlParameter[] collParams) in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 85
   at ServiceProcess.insertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 306
   --- End of inner exception stack trace ---
   at ServiceProcess.insertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 310
   at ServiceProcess.InsertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 58
   at edsWsEmailService.InsertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\edsWsEmailService.cs:line 29


Could you please help me.Zdenek.

RE: Npgsql 1.0.0.0

Hello --

I have had the same problem with the same version of npgsql. It appears to be a problem with asynchronous sockets in ASP.NET. The error stems from BeginConnect on the underlying TCP socket connected to the Postgresql DB. The same exact code works fine under Windows Forms.

I downgraded to 0.7.0.0 and it works.

Some friends of mine could not recreate the error - I believe it can be solved by configuring machine.config or something. I tried changing the user running asp.net, tried running it under administrator privileges, and nothing changed.

If anyone has any thoughts, I'd be very appreciative.

Thank you all,
-Eli

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close