Can't connect to Neo4j db in ASP.NET MVC project


(Hazaaa) #1

Hi guys. I have problem while connecting to my neo4j db.

This is my code:

private GraphClient client;

        public Neo4j()
        {
            client = new GraphClient(new Uri("http://localhost:7474/db/mydb"), "neo4j", "123");

            client.Connect();
        }

And this is error i get when i try to connect.

Message = "Received an unexpected HTTP status when executing the request.\r\n\r\nThe response status was: 404 Not Found\r\n\r\nThe response from Neo4j (which might include useful detail!) was: " .

Thank you guys in front.


(Ljubica Lazarevic) #2

Hi,

Just some quick questions/checks up front:

  • that your Neo4j instance is up and running and is on the local machine that you're running your code from?
  • that the password you're using to connect to your local instance has been set to '123' (from the default password of 'neo4j'). If you're running the instance from Neo4j Desktop, it will ask you to set a password the first time you run it. You will need to run the database each time you start Neo4j Desktop.

Please do let me know how you get on!

Lju


(Hazaaa) #3

Ljubice thank you for your response but somehow i menaged to fix my problem.
I needed to leave "/db/data" as path not "db/mydb". I really don't know why but it worked :)