Erratic debugging behavior / WriteLine won't work.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rico

    Erratic debugging behavior / WriteLine won't work.

    Hello,

    I have Visual Studio 2003, working on a VB.net project. When I try to step
    through the code, the behavior is erratic, stepping in places where no code
    exists, jumping over code sections without any goto lines or anything, and
    also, when I try to use WriteLine, Console.Writeli ne or Debug.Writeline
    nothing happens, nothing comes out in the command window. It's driving me
    nutz!

    Here is a snippet of code that was left with all my test ramblings in it.
    To give you an idea of where the debugger jumps, (at one point that I can
    recall off hand) it will jump from the first "Next" statement down to the
    "dc.AutoIncreme ntStep = -1" line. From there it hits the next blank line,
    then skips the next two lines of code to another blank line, then skips
    another two lines of code landing on the "view2 = New
    DataView(dsInve ntoryTypeOrders .Tables("Orders "))" line.

    Any help would get GREATLY welcomed, as this is taking its tollon me!

    Thanks!

    Private Sub LoadData()

    Dim daOrders As New OleDb.OleDbData Adapter

    Dim daOrderDetails As New OleDb.OleDbData Adapter

    Dim test As Int16

    'TestConnection ()

    Console.WriteLi ne("Test")

    Debug.WriteLine ("Test")

    WriteLine("test ")

    Try

    Dim sql$ = "SELECT 0 AS Selected,
    VendorInventory Types.VendorInv entoryTypesID, VendorInventory Types.Code,
    VendorInventory Types.Category, VendorInventory Types.SubCatego ry,
    VendorInventory Types.Brand, VendorInventory Types.Model,
    VendorInventory Types.Descripti on, 0 AS Quantity,
    VendorInventory Types.RequiresU niqueItems,Vend orInventoryType s.Cost FROM
    (VendorInventor yTypes) WHERE (((VendorInvent oryTypes.Vendor ID)=" &
    lclVendorID & "));"

    daOrders = mdi.dt.GenericD A(sql)

    daOrderDetails = mdi.dt.GenericD A(sql)

    daOrders.Fill(d sInventoryTypeO rders, "Orders") ' = mdi.dt.GenericD S(sql)

    test = dsInventoryType Orders.Tables(" Orders").Rows.C ount

    Dim dr As DataRow

    '
    Debug.WriteLine (dsInventoryTyp eOrders.Tables( "TBL").Columns. Count.ToString) '

    ' Debug.WriteLine (dsInventoryTyp eOrders.Tables( 0).Columns.Coun t.ToString)

    For Each dr In dsInventoryType Orders.Tables(0 ).Rows

    Debug.WriteLine (dr.Item("Selec ted").ToString )

    Next

    Dim dc As DataColumn

    dc.AutoIncremen t = True

    dc.AutoIncremen tSeed = -1

    dc.AutoIncremen tStep = -1

    ' dc.Unique = True

    dc.ColumnName = "GUID"

    dsInventoryType Orders.Tables(0 ).Columns.Add(d c)



    view1 = New DataView(dsInve ntoryTypeOrders .Tables("Orders "))




  • John Bailo

    #2
    Re: Erratic debugging behavior / WriteLine won't work.


    That often happens if you don't make a debug build and the symbols file
    gets out of sync with the code in the editor.


    Rico wrote:[color=blue]
    > Hello,
    >
    > I have Visual Studio 2003, working on a VB.net project. When I try to step
    > through the code, the behavior is erratic, stepping in places where no code
    > exists, jumping over code sections without any goto lines or anything, and
    > also, when I try to use WriteLine, Console.Writeli ne or Debug.Writeline
    > nothing happens, nothing comes out in the command window. It's driving me
    > nutz!
    >
    > Here is a snippet of code that was left with all my test ramblings in it.
    > To give you an idea of where the debugger jumps, (at one point that I can
    > recall off hand) it will jump from the first "Next" statement down to the
    > "dc.AutoIncreme ntStep = -1" line. From there it hits the next blank line,
    > then skips the next two lines of code to another blank line, then skips
    > another two lines of code landing on the "view2 = New
    > DataView(dsInve ntoryTypeOrders .Tables("Orders "))" line.
    >
    > Any help would get GREATLY welcomed, as this is taking its tollon me!
    >
    > Thanks!
    >
    > Private Sub LoadData()
    >
    > Dim daOrders As New OleDb.OleDbData Adapter
    >
    > Dim daOrderDetails As New OleDb.OleDbData Adapter
    >
    > Dim test As Int16
    >
    > 'TestConnection ()
    >
    > Console.WriteLi ne("Test")
    >
    > Debug.WriteLine ("Test")
    >
    > WriteLine("test ")
    >
    > Try
    >
    > Dim sql$ = "SELECT 0 AS Selected,
    > VendorInventory Types.VendorInv entoryTypesID, VendorInventory Types.Code,
    > VendorInventory Types.Category, VendorInventory Types.SubCatego ry,
    > VendorInventory Types.Brand, VendorInventory Types.Model,
    > VendorInventory Types.Descripti on, 0 AS Quantity,
    > VendorInventory Types.RequiresU niqueItems,Vend orInventoryType s.Cost FROM
    > (VendorInventor yTypes) WHERE (((VendorInvent oryTypes.Vendor ID)=" &
    > lclVendorID & "));"
    >
    > daOrders = mdi.dt.GenericD A(sql)
    >
    > daOrderDetails = mdi.dt.GenericD A(sql)
    >
    > daOrders.Fill(d sInventoryTypeO rders, "Orders") ' = mdi.dt.GenericD S(sql)
    >
    > test = dsInventoryType Orders.Tables(" Orders").Rows.C ount
    >
    > Dim dr As DataRow
    >
    > '
    > Debug.WriteLine (dsInventoryTyp eOrders.Tables( "TBL").Columns. Count.ToString) '
    >
    > ' Debug.WriteLine (dsInventoryTyp eOrders.Tables( 0).Columns.Coun t.ToString)
    >
    > For Each dr In dsInventoryType Orders.Tables(0 ).Rows
    >
    > Debug.WriteLine (dr.Item("Selec ted").ToString )
    >
    > Next
    >
    > Dim dc As DataColumn
    >
    > dc.AutoIncremen t = True
    >
    > dc.AutoIncremen tSeed = -1
    >
    > dc.AutoIncremen tStep = -1
    >
    > ' dc.Unique = True
    >
    > dc.ColumnName = "GUID"
    >
    > dsInventoryType Orders.Tables(0 ).Columns.Add(d c)
    >
    >
    >
    > view1 = New DataView(dsInve ntoryTypeOrders .Tables("Orders "))
    >
    >
    >
    >[/color]

    Comment

    • Rico

      #3
      Re: Erratic debugging behavior / WriteLine won't work.

      Thanks John,

      I had some other issues as well (Like no help file associated with VS) so
      out of frustration I uninstalled and re-installed the whole thing.
      Everything seems to be working fine now. (and to think, I spent most of the
      day yesterday thinking it was my code) ;)


      "John Bailo" <jabailo@texeme .com> wrote in message
      news:4418588E.6 080504@texeme.c om...[color=blue]
      >
      > That often happens if you don't make a debug build and the symbols file
      > gets out of sync with the code in the editor.
      >
      >
      > Rico wrote:[color=green]
      >> Hello,
      >>
      >> I have Visual Studio 2003, working on a VB.net project. When I try to
      >> step
      >> through the code, the behavior is erratic, stepping in places where no
      >> code
      >> exists, jumping over code sections without any goto lines or anything,
      >> and
      >> also, when I try to use WriteLine, Console.Writeli ne or Debug.Writeline
      >> nothing happens, nothing comes out in the command window. It's driving
      >> me
      >> nutz!
      >>
      >> Here is a snippet of code that was left with all my test ramblings in it.
      >> To give you an idea of where the debugger jumps, (at one point that I can
      >> recall off hand) it will jump from the first "Next" statement down to the
      >> "dc.AutoIncreme ntStep = -1" line. From there it hits the next blank
      >> line,
      >> then skips the next two lines of code to another blank line, then skips
      >> another two lines of code landing on the "view2 = New
      >> DataView(dsInve ntoryTypeOrders .Tables("Orders "))" line.
      >>
      >> Any help would get GREATLY welcomed, as this is taking its tollon me!
      >>
      >> Thanks!
      >>
      >> Private Sub LoadData()
      >>
      >> Dim daOrders As New OleDb.OleDbData Adapter
      >>
      >> Dim daOrderDetails As New OleDb.OleDbData Adapter
      >>
      >> Dim test As Int16
      >>
      >> 'TestConnection ()
      >>
      >> Console.WriteLi ne("Test")
      >>
      >> Debug.WriteLine ("Test")
      >>
      >> WriteLine("test ")
      >>
      >> Try
      >>
      >> Dim sql$ = "SELECT 0 AS Selected,
      >> VendorInventory Types.VendorInv entoryTypesID, VendorInventory Types.Code,
      >> VendorInventory Types.Category, VendorInventory Types.SubCatego ry,
      >> VendorInventory Types.Brand, VendorInventory Types.Model,
      >> VendorInventory Types.Descripti on, 0 AS Quantity,
      >> VendorInventory Types.RequiresU niqueItems,Vend orInventoryType s.Cost FROM
      >> (VendorInventor yTypes) WHERE (((VendorInvent oryTypes.Vendor ID)=" &
      >> lclVendorID & "));"
      >>
      >> daOrders = mdi.dt.GenericD A(sql)
      >>
      >> daOrderDetails = mdi.dt.GenericD A(sql)
      >>
      >> daOrders.Fill(d sInventoryTypeO rders, "Orders") ' = mdi.dt.GenericD S(sql)
      >>
      >> test = dsInventoryType Orders.Tables(" Orders").Rows.C ount
      >>
      >> Dim dr As DataRow
      >>
      >> '
      >> Debug.WriteLine (dsInventoryTyp eOrders.Tables( "TBL").Columns. Count.ToString) '
      >>
      >> ' Debug.WriteLine (dsInventoryTyp eOrders.Tables( 0).Columns.Coun t.ToString)
      >>
      >> For Each dr In dsInventoryType Orders.Tables(0 ).Rows
      >>
      >> Debug.WriteLine (dr.Item("Selec ted").ToString )
      >>
      >> Next
      >>
      >> Dim dc As DataColumn
      >>
      >> dc.AutoIncremen t = True
      >>
      >> dc.AutoIncremen tSeed = -1
      >>
      >> dc.AutoIncremen tStep = -1
      >>
      >> ' dc.Unique = True
      >>
      >> dc.ColumnName = "GUID"
      >>
      >> dsInventoryType Orders.Tables(0 ).Columns.Add(d c)
      >>
      >>
      >>
      >> view1 = New DataView(dsInve ntoryTypeOrders .Tables("Orders "))
      >>
      >>
      >>[/color][/color]

      Comment

      Working...