Click here to Skip to main content
15,905,875 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to make a xml shared in different Forms? Pin
sanyexian25-Oct-10 0:19
sanyexian25-Oct-10 0:19 
AnswerRe: how to make a xml shared in different Forms? Pin
Gregory Gadow25-Oct-10 5:27
Gregory Gadow25-Oct-10 5:27 
GeneralRe: how to make a xml shared in different Forms? Pin
sanyexian25-Oct-10 15:34
sanyexian25-Oct-10 15:34 
Questionhow to plot line graph Pin
kun8524-Oct-10 22:26
kun8524-Oct-10 22:26 
AnswerRe: how to plot line graph Pin
Andy_L_J25-Oct-10 0:29
Andy_L_J25-Oct-10 0:29 
GeneralRe: how to plot line graph [modified] Pin
kun8525-Oct-10 15:31
kun8525-Oct-10 15:31 
GeneralRe: how to plot line graph Pin
User 58422376-Nov-10 5:28
User 58422376-Nov-10 5:28 
QuestionSystem.NullReferenceException Pin
lemarshall23-Oct-10 18:11
lemarshall23-Oct-10 18:11 
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 the rows MaterialID
                _MATGuid = row.Cells.Item("MaterialID").Value.ToString
                'Now lets check each column to see if any units selected
                strJnts = GridEX1.GetValue("E")
                If strJnts > 0 Then
                    If DoSaveData(strJnts, _MATGuid, 2, "E") = False Then
                        Return False
                        Exit Function
                    End If
                End If
                strJnts = GridEX1.GetValue("B2")
                If strJnts > 0 Then
                    If DoSaveData(strJnts, _MATGuid, 2, "B2") = False Then
                        Return False
                        Exit Function
                    End If
                End If

                strJnts = GridEX1.GetValue("B1")
                If strJnts > 0 Then
                    If DoSaveData(strJnts, _MATGuid, 2, "B1") = False Then
                        Return False
                        Exit Function
                    End If
                End If

                If row.Cells.Item("B").Value <> False Then
                    strJnts = row.Cells.Item("B").Value.ToString
                    If DoSaveData(strJnts, _MATGuid, 2, "B") = False Then
                        Return False
                        Exit Function
                    End If
                End If
                If row.Cells.Item("A").Value <> False Then
                    strJnts = row.Cells.Item("A").Value.ToString
                    If DoSaveData(strJnts, _MATGuid, 2, "A") = False Then
                        Return False
                        Exit Function
                    End If
                End If
            Next

        End If

    Catch ex As System.NullReferenceException
        Debug.Print(ex.ToString)
    End Try

    Return True

End Function

AnswerRe: System.NullReferenceException Pin
Dave Kreskowiak24-Oct-10 3:14
mveDave Kreskowiak24-Oct-10 3:14 
GeneralRe: System.NullReferenceException Pin
lemarshall24-Oct-10 5:28
lemarshall24-Oct-10 5:28 
QuestionShifting Focus From UserForm to Sheet Pin
Win32SF23-Oct-10 15:07
Win32SF23-Oct-10 15:07 
QuestionVisual Basic .net digital signature Pin
crain198122-Oct-10 12:29
crain198122-Oct-10 12:29 
AnswerRe: Visual Basic .net digital signature Pin
Dave Kreskowiak22-Oct-10 13:28
mveDave Kreskowiak22-Oct-10 13:28 
GeneralRe: Visual Basic .net digital signature Pin
crain198122-Oct-10 14:22
crain198122-Oct-10 14:22 
QuestionVisual Basic Encryption Pin
crain198122-Oct-10 3:15
crain198122-Oct-10 3:15 
AnswerRe: Visual Basic Encryption Pin
Gregory Gadow22-Oct-10 3:54
Gregory Gadow22-Oct-10 3:54 
AnswerRe: Visual Basic Encryption Pin
Herboren23-Oct-10 18:48
Herboren23-Oct-10 18:48 
QuestionSend Commands Directly to a Printer Pin
εїзεїзεїз20-Oct-10 23:12
εїзεїзεїз20-Oct-10 23:12 
AnswerRe: Send Commands Directly to a Printer Pin
Goutam Patra21-Oct-10 0:31
professionalGoutam Patra21-Oct-10 0:31 
GeneralRe: Send Commands Directly to a Printer Pin
εїзεїзεїз22-Oct-10 19:25
εїзεїзεїз22-Oct-10 19:25 
AnswerRe: Send Commands Directly to a Printer Pin
Rajesh Anuhya21-Oct-10 20:03
professionalRajesh Anuhya21-Oct-10 20:03 
GeneralRe: Send Commands Directly to a Printer Pin
εїзεїзεїз22-Oct-10 19:23
εїзεїзεїз22-Oct-10 19:23 
GeneralRe: Send Commands Directly to a Printer Pin
Dave Kreskowiak23-Oct-10 3:53
mveDave Kreskowiak23-Oct-10 3:53 
AnswerRe: Send Commands Directly to a Printer Pin
Rajesh Anuhya24-Oct-10 21:41
professionalRajesh Anuhya24-Oct-10 21:41 
AnswerCódigo para validar cpf no Access xp Pin
Raphael4920-Oct-10 20:15
Raphael4920-Oct-10 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.