Eae gente .. seguinte ..
vou ser direto.
estou tentando conectar o postgresql com o asp.net
ja usei uma dll chamada npgsql.dll
só q da um erro falando q não esta achando o banco de dados sendo q esta certo =\
aqui segue o codigo...
NpgsqlConnection con = new NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=postgres;Password=outro.;Database=teste;");
con.Open();
NpgsqlCommand comando =new NpgsqlCommand ("select * from ca_clientes",con);
...e da erro na conexao falando q nao esta encontrando o banco ;\
System.IO.FileNotFoundException was unhandled by user code
HResult=-2147024894
Message=Could not load file or assembly 'Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. O sistema não pode encontrar o arquivo especificado.
Source=Npgsql
FileName=Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
FusionLog==== Pre-bind state information ===
LOG: User = Windows-PC\Windows
LOG: DisplayName = Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
(Fully-specified)
LOG: Appbase = file:///c:/users/windows/documents/visual studio 2012/Projects/WebApplication1/WebApplication1/
LOG: Initial PrivatePath = c:\users\windows\documents\visual studio 2012\Projects\WebApplication1\WebApplication1\bin
Calling assembly : Npgsql, Version=2.0.12.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\users\windows\documents\visual studio 2012\Projects\WebApplication1\WebApplication1\web.config
LOG: Using host configuration file: C:\Users\Windows\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
StackTrace:
at Npgsql.NpgsqlConnection..ctor(String ConnectionString)
at WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in c:\Users\Windows\Documents\Visual Studio 2012\Projects\WebApplication1\WebApplication1\WebForm1.aspx.cs:line 20
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
se alguem puder me ajudar agradeco desde já :D