ASP.net: Create Database Connection Wont Save

Wappler Version :
4.0.0

Operating System :
Windows 10

Server Model:

Database Type:
MySQL/MariaDB

Hosting Type:
Dedicated Windows Server 2012 using PLESK

Expected behavior

What do you think should happen?

I should be able to create a database connection using database manager, test it, then save it

Actual behaviour

I can create a database connection and test it successfully but save button does nothing. Debug text generates is as follows:

TypeError: Cannot read property ‘prefix’ of undefined at generateConnectionString (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/UI/Databases/dmxDatabaseConnection_lib.js:84:26) at file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:38049 at Object.callback (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/UI/Databases/dmxDatabaseConnection_lib.js:153:9) at Object.dmxDWApiBridge.applyCallback (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxNWApiBridge.js:8:9509) at Object.dmxDWApiBridge.pathExists (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxNWApiBridge.js:8:45414) at file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxNWApiBridge.js:8:275 at Object.pathExists (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxDWApi.js:8:14100) at readDatabaseConfigFile (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/UI/Databases/dmxDatabaseConnection_lib.js:149:10) at HTMLButtonElement. (file:///C:/Users/micro/AppData/Local/Wappler/resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:37753) at HTMLButtonElement.dispatch (C:\Users\micro\AppData\Local\Wappler\resources\app\node_modules\jquery\dist\jquery.js:5430:27) at HTMLButtonElement. (C:\Users\micro\AppData\Local\Wappler\resources\app\node_modules\jquery\dist\jquery.js:5234:28) at HTMLButtonElement.sentryWrapped (C:\Users\micro\AppData\Local\Wappler\resources\app\node_modules@sentry\electron\node_modules@sentry\browser\dist\helpers.js:74:23)

How to reproduce

Open project -> select database manager -> create database parameters -> test database connection -> click save button

Notes: I have reinstalled Wappler and started a new project but the same error above persists. I have also searched the forum for similar, I found one instance of this but there was no solution to the problem.

Are you able to add the connection in Server Connect under the global connections there?

I can’t do it in the globals either, when I try and test the connection I get : ‘Error using this database connection! Server response: Runtime Error’

This happens regardless of which version of ODBC driver I’m using.

I’m not sure if this is relevant but all original settings worked fine in the 3.9.x version

Are you sure you want to connect with asp.net to MySQL with ODBC and you have all the installed drivers available?

If that is not the case you will get this runtime error indeed.

ASP.net with MySQL is also a very rare combination, usually you use ms sql server / express with asp.net

Weve been using classic ASP with MySQL for 17+ years with no issues, no issues either with .NET. All our ODBC drivers on the server have been running just fine, they also ran just fine on Wappler 3.9.x with the same asp.net MySQL combo …

Update - I just tried a new project with PHP/MySQL and it worked. I also tried a new project with Classic ASP/MySQL combo and I was able to create and connect a new database connection in the Globals Database Connections list, however, when I try and connect via the Database manager database connections section I get the following error:
CONNECT ECONNREFUSED 127.0.0.1:3306

The database manager makes a direct connection to your database … you need to enter the credentials for direct/remote connection. 127.0.0.1 is your localhost.

Thanks for that, I’d wrongly assumed that creating it in globals would propagate the same settings to the database manager…

I just did the above and tried it out on Classic ASP / MySQL and it worked fine, the issues with ASP.NET / MySQL remain…

Update: I think I have resolved this issue so am posting back in case someone else has the same issues. I’m not sure how it worked or what caused this issue, but I totally removed the Wappler4.beta then re-installed the production 4.0.x version. I had to do two reinstalls (on the first re-install Wappler was crashing when inputting the db conn details). I then opened up my test project and hey presto it all worked.

Phew, I’m glad that’s out the way… Now onto testing the new glass themes out :sunglasses:

Fixed in Wappler 4.0.1

1 Like

This topic was automatically closed after 31 hours. New replies are no longer allowed.