Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. System.NullReferenceException

System.NullReferenceException

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasedata-structures
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lemarshall
    wrote on last edited by
    #1

    using vb.net 2008 and latest version of JanusSystem GridEx. When I use the Try..Catch..Finally I get an error message when I am trying to get the data from the cell in a row. There can be up to 5 cells that the user has entered data into that I need to pull out if the SelectedRow is checked. If there is data in the cell I can extract it and store it to the table. If I check the next column and it is empty I get the error message below:

    A first chance exception of type 'System.NullReferenceException' occurred in Janus.Windows.GridEX.v3.dll
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Janus.Windows.GridEX.GridEXCellCollection.get_Item(GridEXColumn column)
    at Janus.Windows.GridEX.GridEX.GetValue(GridEXColumn column)
    at Janus.Windows.GridEX.GridEX.GetValue(String columnKey)
    at JWI.frmLOL.SaveTab1(Object& _frmGuid) in C:\JWI\JWI\JWI\frmLOL.vb:line 708

    If I use the old VB6 On Error Resume Next then I don't even pick up the data that is in the cells, the code just goes right over the lines:

    strJnts = GridEX1.GetValue("E") 'or "B1" or "B2" etc

    And I never hit the DoSaveData function. Not sure what the solution is or even the problem. I've tried at least a dozen diferrent codings for IsNotDBNull and anything I could find in the MSDN and online but nothing seems to help. I have a message into the JanusSystem forum but they won't be answering until mid morning Monday and I would like a solution later tonight or Sunday if possible. The entire function code follows:

    Public Function SaveTab1(ByRef \_frmGuid As Object) As Boolean
        Dim rowNdx As Integer = 0 'Set to zero index value 
        Dim strJnts As String
        Dim \_MATGuid As Object
        Try
            'On Error Resume Next
            GridEX1.BoundMode = Janus.Windows.GridEX.BoundMode.Unbound
            'allows us to use it in AddItem mode 
            GridEX1.KeepRowSettings = True
            'keeps settings same when row scrolls out of sight 
            Dim checkedRows() As Janus.Windows.GridEX.GridEXRow
            checkedRows = GridEX1.GetCheckedRows()
            'if the user didn't check any row, you will get an empty array 
            If checkedRows.Length = 0 Then
                'no materials on Tab1 Tubing so we need to check Tab2 Pipe
                'SaveTab2()
            Else
                Dim row As Janus.Windows.GridEX.GridEXRow
                For Each row In checkedRows
                    'get th
    
    D 1 Reply Last reply
    0
    • L lemarshall

      using vb.net 2008 and latest version of JanusSystem GridEx. When I use the Try..Catch..Finally I get an error message when I am trying to get the data from the cell in a row. There can be up to 5 cells that the user has entered data into that I need to pull out if the SelectedRow is checked. If there is data in the cell I can extract it and store it to the table. If I check the next column and it is empty I get the error message below:

      A first chance exception of type 'System.NullReferenceException' occurred in Janus.Windows.GridEX.v3.dll
      System.NullReferenceException: Object reference not set to an instance of an object.
      at Janus.Windows.GridEX.GridEXCellCollection.get_Item(GridEXColumn column)
      at Janus.Windows.GridEX.GridEX.GetValue(GridEXColumn column)
      at Janus.Windows.GridEX.GridEX.GetValue(String columnKey)
      at JWI.frmLOL.SaveTab1(Object& _frmGuid) in C:\JWI\JWI\JWI\frmLOL.vb:line 708

      If I use the old VB6 On Error Resume Next then I don't even pick up the data that is in the cells, the code just goes right over the lines:

      strJnts = GridEX1.GetValue("E") 'or "B1" or "B2" etc

      And I never hit the DoSaveData function. Not sure what the solution is or even the problem. I've tried at least a dozen diferrent codings for IsNotDBNull and anything I could find in the MSDN and online but nothing seems to help. I have a message into the JanusSystem forum but they won't be answering until mid morning Monday and I would like a solution later tonight or Sunday if possible. The entire function code follows:

      Public Function SaveTab1(ByRef \_frmGuid As Object) As Boolean
          Dim rowNdx As Integer = 0 'Set to zero index value 
          Dim strJnts As String
          Dim \_MATGuid As Object
          Try
              'On Error Resume Next
              GridEX1.BoundMode = Janus.Windows.GridEX.BoundMode.Unbound
              'allows us to use it in AddItem mode 
              GridEX1.KeepRowSettings = True
              'keeps settings same when row scrolls out of sight 
              Dim checkedRows() As Janus.Windows.GridEX.GridEXRow
              checkedRows = GridEX1.GetCheckedRows()
              'if the user didn't check any row, you will get an empty array 
              If checkedRows.Length = 0 Then
                  'no materials on Tab1 Tubing so we need to check Tab2 Pipe
                  'SaveTab2()
              Else
                  Dim row As Janus.Windows.GridEX.GridEXRow
                  For Each row In checkedRows
                      'get th
      
      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your best source of information is going to be Janus' support forums. From the tack trace, it looks like you may have found a problem with their control.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Your best source of information is going to be Janus' support forums. From the tack trace, it looks like you may have found a problem with their control.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        L Offline
        L Offline
        lemarshall
        wrote on last edited by
        #3

        Bummer, I have used the grid extensively to fill up with data and have the user group and sort the information. Love it for that, but this is first time trying to take a virtually empty grid and grab just the selected data from it. I've tried setting the value to <> Empty, Nothing, DBNull and many other things. Their sampls show them using a grid similarly for an odering application so I'm trying now to follow the code to see if I can locate how they check for a null value in a selected row cell. I'm also looking at how the settings for the myriad of properties may be different than the default. If any ideas pop up please let me know, Larry

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups