This topic is locked
[SOLVED]

Strange Error Updating TABLE

5/20/2021 4:17:33 PM
ASPRunner.NET General questions
acacio.rapaz@fastdata.pt author

Good afternoon,
I am sorry but I have been with this error for 2 days.
When I try to update a table with a value I get this error, I don't know what I'm doing wrong.

Type of Error 500
Error Cannot perform runtime binding on a null reference
URL http://localhost:8087/buttonhandler/
Arquivo de Erro
Line Error 0
SQL SELECT top 1 [ID], [Nome], [Servidor], [Porta], [Login], [Password], [BaseDados], [Email], [Observacoes] FROM [dbo].[Empresa] WHERE ( ( ( ( ID=1 ) ) ) )

CODE in button Server side:

dynamic data = XVar.Array();
dynamic keyvalues = XVar.Array();
dynamic buttonid = null;

data["Porta"] = 3389;
keyvalues["ID"] = buttonid.getCurrentRecord();

DB.Update("Empresa", data, keyvalues);

img alt

img alt

img alt

admin 5/20/2021

The following line is incorrect:
keyvalues["ID"] = buttonid.getCurrentRecord();

getCurrentRecord returns an array and you cannot use it a single value. More info is in the manual: getCurrentRecord()

acacio.rapaz@fastdata.pt author 5/20/2021

Thanks
How can I return the current ID but not in an array.

admin 5/20/2021

See the examples in the manual, the link that I have supplied.

acacio.rapaz@fastdata.pt author 5/21/2021

Nice Thanks for your Help.