Results 1 to 5 of 5

Thread: [RESOLVED] [2005] rw.Item("var") DBNull.Value

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    Iowa
    Posts
    298

    Resolved [RESOLVED] [2005] rw.Item("var") DBNull.Value

    How do I check to see if rw.Item("Type") is Null and if it is skip it?


    Code:
      Public Sub GetCodeType(ByVal Code As String)
            Dim rw As DataRow
    
            Me.DsCodeTypes1.Clear()
            Me.sdaCodeTypes.Fill(DsCodeTypes1)
    
            Dim TypeNumber As Integer = CInt(Mid(Code, 8, 5))
    
            For Each rw In Me.DsCodeTypes1.Tables("BarCode").Rows
    
                If Trim(rw.Item("BarCode_Unique")) = TypeNumber Then
    
                    CodeType = rw.Item("Type")

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: [2005] rw.Item("var") DBNull.Value

    Code:
    IF Not rw.IsDBNull("Type") Then
       Do what ever here
    End If
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    Iowa
    Posts
    298

    Re: [2005] rw.Item("var") DBNull.Value

    ISDBNull is not a member of System.Data.DataRow

  4. #4
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2005] rw.Item("var") DBNull.Value

    Code:
     If Not IsDBNull(rw.Item("type")) Then
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    Iowa
    Posts
    298

    Re: [2005] rw.Item("var") DBNull.Value

    Yeah thanks fellas. I can't wait till I'm smart enough to help others. ha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width