Error: NullReferenceException

outlawz

Member
Licensed User
Hi to you all. I´m a begginner with Basic4PP, I started a few days ago and I decided to make a program to help with my work, on annual stock control. With a great help of some of you, i make the code i attach. That code works well on desktop, i just only need to make some improvments but is ready to help me out. However when i compile and test on the device i got the error: NullReferenceException on that prodedures:

1. one sub that change table columns width:
Sub tamanhocolunas()
table1.ColWidth("artigo") = 75
table1.ColWidth("ubic") = 25
table1.ColWidth("act") = 20
table1.ColWidth("conta") = 30
table1.ColWidth("descricao") = 85
table1.ColWidth("fam") = 25
table1.ColWidth("subf") = 25
table1.ColWidth("IDPK") = 30
End Sub

2. one sub developed by Erel on is editable procedure that i changed to fill my needs
' TRYING TO UPDATE DATABASE
'This sub will be called before setting any value in table1.
'The value will only be set if Validate returns true.
Sub Validate(column, value,row)
chave=Table1.Cell("IDPK",row)
If column <> "conta" AND Not(IsNumber(value)) Then
Msgbox("ERROR: Solamente puede editar la columna [conta] e tiene de poner valor numerico.")
Return False
Else
cmd.CommandText = "UPDATE inventario SET conta = "& value & " WHERE IDPK = "& chave
cmd.ExecuteNonQuery
Return True
End If
End Sub

I attached complete code with a compact database due to size attach limitations. I hope that someone could help me to put that working.

Thanks a lot. Regards.
 

N1c0_ds

Active Member
Licensed User
It's missing some DLL files (or you are not using the right ones)

Recompile it but read attentively the messagebox once it's compiled. My guess: You're missing the System.Data.SQLite dll.
 

outlawz

Member
Licensed User
Hi Nico, I deleted the DLLS before post to save space on file attached. All the DLL´s are copied to the work folder when i add the components. I think that if i don´t add the components, the code won´t work on desktop, correct me if i´m wrong. In my case the code works well on desktop, what does´t happen after compile and tested on device.

Do you think I´m wrong? Do you have some way for me to test if some DLL´s are missing?

Thanks
 

outlawz

Member
Licensed User
As soon i select a local on combo and press the button the error happens. I compile to the work folder and copy the entire folder to the device. There are 2 things i must tell to you as it could have something to do with the error:

1. I compile QVGA as my device is a QVGA HTC Kaiser;

2. I was not able to install on device NET Frameworks as same version comes in the ROM.

Thanks
 

outlawz

Member
Licensed User
The regular compile doest´t work, same error. If I compile to windows another error i attach. As you can see all the required files (I think) are on the work folder and copied to device.

Thanks.
 

outlawz

Member
Licensed User
Hi people. I tried the compiled file on other device and it works. Must be a problem on my ROM installed FRAMEWORKS. I don´t know why the desktop compile does´t work.

Regards
 
Top