Cannot connect to databse

This forum is for programmers who have questions about the source code.
Post Reply
alien
Posts: 3
Joined: Thu Oct 11, 2018 8:41 am

Cannot connect to databse

Post by alien » Thu Oct 11, 2018 8:50 am

I downloaded source code and want to translate the project,but when i run i cannot connect to database ? can someone please tell me what i have to do,
in databaseconnection.cs

string computerName= "";
string database= "";
string user="";
string password="";

I enter my conn details and i receive an error
Database not present, Could not establish connection

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Cannot connect to databse

Post by jsalmon » Thu Oct 11, 2018 8:57 am

You probably just want to invoke DataConnection.SetDb() if you are doing custom coding. Otherwise; just use the Choose Database window when it shows up after launching Open Dental.
If you are having a MySQL error then you'll need to provide the specific error so that we can help you with that. If the error you are getting is the "Database not present" bit then you don't have a database created with the corresponding name that you are providing into the database variable. The easiest remedy for that would be to use a demo or blank database from our Trial:
https://www.opendental.com/trial.html
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

alien
Posts: 3
Joined: Thu Oct 11, 2018 8:41 am

Re: Cannot connect to databse

Post by alien » Thu Oct 11, 2018 9:06 am

I try to connect it via Visual Studio 2017 when i debug the project it shows me that error


string computerName= "localhost";
string database= "opendental";
string user="root";
string password="1234";

Do the source code have an .sql script to execute the database ??

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Cannot connect to databse

Post by jsalmon » Thu Oct 11, 2018 9:23 am

There is no script to run (unless you run our Unit Tests which will technically create a database for you automatically). I highly suggest you read the following page on our website in detail. The second sentence on the page says:
REQUIREMENT: You must first install the Trial Version so you can see the files involved in the installation process. This is the ONLY way to get the initial database tables installed. Then you can later attempt to compile the source code files.
https://www.opendental.com/site/sourcecode.html

That page contains a plethora of other information that will help you throughout your programming adventures.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

alien
Posts: 3
Joined: Thu Oct 11, 2018 8:41 am

Re: Cannot connect to databse

Post by alien » Thu Oct 11, 2018 9:26 am

I created a database opendental but still cannot connect into it

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Cannot connect to databse

Post by jsalmon » Thu Oct 11, 2018 11:48 am

I suggest calling in to support so they can help you get your Trial up and running (e.g. so that you can connect to your database).
https://www.opendental.com/contact.html
Once you are allowed to connect to the database with the Trial version then we can start having the conversation as to what you are doing incorrectly in your development environment.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply