You can translate the question and the replies:

ErrorMessage while open connection to Denodo via npgsql in c#

Hi, I am trying to connect to Denodo (Version 7), via c# code. I installed npqsql (version 4.0.6) and created a connection string with: {host} {port} {username} {passwd} {database} and the SSL-Mode as required. (user and pwd combination was checked via Launch Pad) For trying I use a simple select statement. If I call Open() on my NpqsqlConnection object I get the error message {"Received unexpected backend message ParseComplete. Please file a bug."} For beeing sure I tried to ping the host, which works fine. And if I try without SSl, the error message indicates that the SSl is required, therefor I think the correct backend is found. Could someone give me a hint? Thanks
user
08-05-2019 02:32:19 -0400
code

5 Answers

Hi, On looking at the error message “Received unexpected backend message ParseComplete. Please file a bug”, it seems to be related with npgsql. In this scenario, I would check the vdp.log file located at “<DENODO_HOME>\logs\vdp" folder to know more about the error. Apart from this, I would try to connect to Virtual DataPort from C# using Entity Framework, which can be found under *<DENODOHOME>\samples\vdp\vdp-clients-EntityFramework* folder. Ensure to use the Npgsql Driver which is compatible with PostgreSQL ADO.NET driver to connect Entity Framework with Denodo. For more information, I would suggest you to refer to the **README** file present in the EntityFramework directory. Also, you can take a look at [Access Through an ADO.NET Data Provider](https://community.denodo.com/docs/html/browse/6.0/vdp/developer/access_through_an_ado.net_data_provider/access_through_an_ado.net_data_provider#access-through-an-ado-net-data-provider) section under the Virtual DataPort Developer Guide for more details. Hope this helps!
Denodo Team
08-05-2019 05:54:30 -0400
code
Hello, thanks for your answer, but I am still not able to connect to Denodo DB via C#. I tried it with the example. Installed the given Npqsql package ( <package id="EntityFramework" version="6.0.0" targetFramework="net40-client" /> <package id="Npgsql" version="2.2.7" targetFramework="net40-client" /> <package id="Npgsql.EntityFramework" version="2.2.7" targetFramework="net40-client" />). Adapt the <connectionStrings> in the App.config ( <connectionStrings> <add name="SampleContext" connectionString="Server=***;Port=9996;Database=****;User Id=****;Password=***;SSL =true;" providerName="Npgsql" /> </connectionStrings>) I need the SSL-connection. If I do not use it, I got an exception, that I need SSL -> so I think the Denodo database is found. When I start the program I got the following exception "+ InnerException {"ERROR: : authentication error: Database 'template1' not found"} System.Exception {Npgsql.NpgsqlException}" In the whole project I never use template1 and it seems that the connection is not established, as the same error message is given if I use a wrong password. Could you help here? Thanks Jessica
user
13-05-2019 02:32:20 -0400
Hi, The error **“ERROR: : authentication error: Database ‘template1’ not found”} System.Exception {Npgsql.NpgsqlException}”** usually occurs when the specified database is not present in the Virtual DataPort. Hence, I would create a database in Virtual DataPort ('template1' in your case) to overcome this error. I would also give necessary privileges (for eg: Connect) over the database to the user accessing from Entity Framework. Also, I would ensure that the connection string consists of a valid server name and port number of the Virtual DataPort Server. For more details, you can refer to [Creating Databases](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/databases_users_and_access_rights_in_virtual_dataport/administration_of_databases_users_roles_and_their_access_rights/creating_databases#creating-databases) section and [Configuring and Deleting Databases](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/databases_users_and_access_rights_in_virtual_dataport/administration_of_databases_users_roles_and_their_access_rights/configuring_and_deleting_databases#configuring-and-deleting-databases) section under the Virtual DataPort Administration Guide. Hope this helps!
Denodo Team
20-05-2019 02:22:15 -0400
code
Hi, sorry, that does not help at all. The database is not given in the code. So it would not be parametrise at all (and I would need to create a seperat e data schema for C# - connection). I will stopp to try this, we will have to work with relational databases again. It is a great pity Jessica
user
22-05-2019 05:25:05 -0400
Hi, Based on the information in this [link](http://www.npgsql.org/ef6/index.html#template-database), the database 'Template1' is used implicitly by Npgsql when accessing from Entity Framework. To resolve the error, I would create the required database (Template1) in the Virtual DataPort and provide necessary privileges over it to the user accessing from Entity Framework. In this scenario, it is not necessary to make any changes in the code. Hope this helps!
Denodo Team
29-05-2019 08:12:33 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here