C# Postgree Connection Error - Locaweb

Asked

Viewed 250 times

1

Dear I have a webservice consuming postgreesql data and when I try to connect with the base after posting. The host I’m trying to use: "servoripanema.no-ip.info"

Npgsql.Npgsqlexception: Failed to Establish a Connection to '177.195.43.242'. ---> System.Security.Securityexception: Request for the permission of type 'System.Net.Socketpermission,failed.

I got in touch with Ocaweb and for surprise they did the test put in php and it worked:

   <?php
    if(!@($conexao=pg_connect ("host=177.193.40.222 
     dbname=bdteste port=5438   user=admin password=xxxxx"))) {
     print "Não foi possível estabelecer uma conexão com o banco de dados.";
     } else {
     pg_close ($conexao);
     print "Conexão OK!"; 
     }
   ?>

Someone’s been through it?

  • 1

    Man, this Locaweb is about throwing money away (I’ve used it myself)! This Trustlevel problem is old, www.smarterasp.net is the best I know so far! (Well I could get some money for advertising, but the service has been really good!)

  • The strange thing is that when I switch to the database offered by them, it works normally. Does Npgsql not allow host connections?

1 answer

4


You need to have the application Trustlevel as FullTrust to execute the NpgsqlException.

Locaweb does not allow applications using FullTrust.

Solution: change the preview or accommodation.

  • The strange thing is that when I switch to the database offered by them, it works normally. Does Npgsql not allow host connections?

  • @Andersonmachado as I said, the problem is that Locaweb does not allow you to run applications as fulltrust. This is not a problem with npgsql

  • It’s boy, I just believe. I put in windows Azure and it worked. This Locaweb is a delay of life.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.