Database Insert Throwing Exception

Hi all…!

I’ve been banging my head again with this one, I’m trying to add some user details to our MySQL db - We are using .NET to do this.

It’s all working as it should, and the records are successfully added to the db table, however, once added to the db the page is throwing an exception. It looks like a Wappler (V5) core exception and I’m having problems deciphering it - can anyone out there point me in the right direction?

Here’s the crux of the problem:

StackTraceString	"   at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i)\r\n   at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)\r\n   at System.Data.Odbc.OdbcCommand.ExecuteScalar()\r\n   at DMXzone.ServerConnect.Database.MySql.GetIdentity(IDbConnection connection) in C:\\Development\\Server Connect\\ASPNET_Source\\DMXzone Database Connector\\Database\\MySql.cs:line 96\r\n   at DMXzone.ServerConnect.Database.Connector.Execute(SqlBuilder sql) in C:\\Development\\Server Connect\\ASPNET_Source\\DMXzone Database Connector\\Database\\Connector.cs:line 203"
RemoteStackTraceString	null
RemoteStackIndex	0
ExceptionMethod	"8\nGetSqlType\nSystem.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\nSystem.Data.Odbc.OdbcDataReader\nSystem.Data.Odbc.TypeMap GetSqlType(Int32)"
HResult	-2146233066
Source	"System.Data"

The page in question is here, feel free to try it out:
https://valet-pal.com/entry/valeters-signup.aspx

Any assistance is greatly appreciated…

Just another update, I’m creating a brand new, very basic database insert form and am currently testing it - it’s giving the same/similar errors to the one above so far. I’m not sure if I’ve found a bug or if I’ve done something wrong - I’m suspecting it’s a bug so far.

I’ll post more findings soon…

Seeing:
“orgException”: {
“ClassName”: “System.Reflection.TargetInvocationException”,
“Message”: “Exception has been thrown by the target of an invocation.”,
“Data”: null,
“InnerException”: {
“ClassName”: “System.OverflowException”,
“Message”: “Arithmetic operation resulted in an overflow.”,
“Data”: null,
“InnerException”: null,
“HelpURL”: null,
“StackTraceString”: " at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i)\r\n at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)\r\n at System.Data.Odbc.OdbcCommand.ExecuteScalar()\r\n at DMXzone.ServerConnect.Database.MySql.GetIdentity(IDbConnection connection) in C:\Development\Server Connect\ASPNET_Source\DMXzone Database Connector\Database\MySql.cs:line 96\r\n at DMXzone.ServerConnect.Database.Connector.Execute(SqlBuilder sql) in C:\Development\Server Connect\ASPNET_Source\DMXzone Database Connector\Database\Connector.cs:line 203",
“RemoteStackTraceString”: null,
“RemoteStackIndex”: 0,
“ExceptionMethod”: “8\nGetSqlType\nSystem.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\nSystem.Data.Odbc.OdbcDataReader\nSystem.Data.Odbc.TypeMap GetSqlType(Int32)”,
“HResult”: -2146233066,
“Source”: “System.Data”,

Check for an inner exception. If none, check logs for the exception that occurred prior to this one. the thread receiving this exception is running some asynchronous code and causing an exception.

HINT: Check the database connection string

1 Like

Thanks for that help, I checked the database connection string and it all appeared well. The records are added to the database correctly but the errors are generated immediately after in insert happens. I’ve been on this for days and am totally stumped.

I created another stripped-down form and tested again using a different connection and new APIs and still got the same error.

I created a bare bones form here:
https://valet-pal.com/test-form4.aspx

My Server Action looks like this:

I’m using MySQL ODBC to connect to the database and the connection is reported back from Wappler as being totally fine.

Can anyone see where I’m going wrong…?

Try to configure both user DSN and System DSN for this connection in the ODBC data source, and create DSN and test in both 32-bit/64-bit ODBC data source.

1 Like

I’m on this now, it seems like an ODBC issue but the bug reports are very ambiguous. I’m also trying different ODBC versions (3.51, 5.3 and 8). The original ODBC was 3.1 - Wappler reported this was all working fine yet this is where my issues started.

It looks like my DSN is fine, I tried db connections using DW and it worked perfectly using 3.15 and 5.1 - I reverted back to 3.15 and Wappler correctly adds the record to the database yet still throws a 500 error right after.

The debugger is impossible to decipher so I’m guessing it’s a Wappler issue. I’m going to uninstall and then reinstall Wapperl (yet again) to see if that makes a difference.

I must say, I really do like Wappler however it’s the most temperamental piece of software I’ve ever used.

Update: I tried the reinstall and created a fresh form and the same is happening. I’ve been on this for almost five days now so time to report it as a bug.

Considered another database ?

1 Like

That is not an option I’m afraid, we’re running another 30 sites on the same server, all using the same database set up (but not created via Wappler) with no issues.

I opened a bug report and found out what the issue was after @Patrick had a fresh look at it. Heres the link in case theres anyone out there experiencing similar:

Cool. Surprised you had to set that flag. But glad it’s sorted out

1 Like

Not as surprised as I was har har har…That was a tough one, I’m glad it’s behind me now - onwards and upwards.!