本文介绍了如何通过asp.net连接到postgresql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过asp.net连接到postgresql数据库,但即使在正确编写代码后也会反复出现此错误。任何人都可以帮我解决这里的解决方案是我的代码? : -



Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Button1.Click

Dim con作为NpgsqlConnection

con =新的NpgsqlConnection(server = localhost; port = 5432; userid = mayank; password = manager; database = postgres)

con.Open()

MsgBox(已打开)



结束次级



错误我得到的是: -



无法加载文件或程序集'Mono.Security,Version = 1.0.5000.0,Culture = neutral,PublicKeyToken = 0738eb9f132ed756'或其中一个它的依赖关系。定位的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)



我已添加monosecurity.dll作为参考但尚未连接到postgresql db ... m使用npgsql驱动程序连接到postgresql数据库

I am trying to connect to postgresql databse through asp.net but getting this error again and again even after writing code correctly. Can anyone please help me out with the solution here is my code? :-

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As NpgsqlConnection
con = New NpgsqlConnection("server=localhost;port=5432;userid=mayank;password=manager;database=postgres")
con.Open()
MsgBox("opened")

End Sub

Error that i am getting is :-

Could not load file or assembly 'Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I have added monosecurity.dll as refernce yet not getting connected to postgresql db...m using npgsql driver to connect to postgresql database

推荐答案


这篇关于如何通过asp.net连接到postgresql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:34