Error: NullReferenceException

Discussion in 'Questions (Windows Mobile)' started by outlawz, Dec 14, 2008.

  1. outlawz

    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
    '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)
    If column <> "conta" AND Not(IsNumber(value)) Then
    Msgbox("ERROR: Solamente puede editar la columna [conta] e tiene de poner valor numerico.")
    Return False
    cmd.CommandText = "UPDATE inventario SET conta = "& value & " WHERE IDPK = "& chave
    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.
  2. N1c0_ds

    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.
  3. outlawz

    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?

  4. Erel

    Erel Administrator Staff Member Licensed User

    I've compiled it and it runs fine on the device.
    When does the error happen?
  5. Erel

    Erel Administrator Staff Member Licensed User

    Make sure that you've copied all image files to the device.
  6. outlawz

    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.

  7. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that it is related but you should use the regular compile option. Not Forced QVGA.
  8. outlawz

    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.

  9. outlawz

    outlawz Member Licensed User

    Do I need to install some kinf of SQL interpreter/Library on the device? Thanks.
  10. outlawz

    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.

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice