By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Erratic debugging behavior / WriteLine won't work.

P: n/a
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.Writeline 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.AutoIncrementStep = -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(dsInventoryTypeOrders.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.OleDbDataAdapter

Dim daOrderDetails As New OleDb.OleDbDataAdapter

Dim test As Int16

'TestConnection()

Console.WriteLine("Test")

Debug.WriteLine("Test")

WriteLine("test")

Try

Dim sql$ = "SELECT 0 AS Selected,
VendorInventoryTypes.VendorInventoryTypesID, VendorInventoryTypes.Code,
VendorInventoryTypes.Category, VendorInventoryTypes.SubCategory,
VendorInventoryTypes.Brand, VendorInventoryTypes.Model,
VendorInventoryTypes.Description, 0 AS Quantity,
VendorInventoryTypes.RequiresUniqueItems,VendorInv entoryTypes.Cost FROM
(VendorInventoryTypes) WHERE (((VendorInventoryTypes.VendorID)=" &
lclVendorID & "));"

daOrders = mdi.dt.GenericDA(sql)

daOrderDetails = mdi.dt.GenericDA(sql)

daOrders.Fill(dsInventoryTypeOrders, "Orders") ' = mdi.dt.GenericDS(sql)

test = dsInventoryTypeOrders.Tables("Orders").Rows.Count

Dim dr As DataRow

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

' Debug.WriteLine(dsInventoryTypeOrders.Tables(0).Co lumns.Count.ToString)

For Each dr In dsInventoryTypeOrders.Tables(0).Rows

Debug.WriteLine(dr.Item("Selected").ToString)

Next

Dim dc As DataColumn

dc.AutoIncrement = True

dc.AutoIncrementSeed = -1

dc.AutoIncrementStep = -1

' dc.Unique = True

dc.ColumnName = "GUID"

dsInventoryTypeOrders.Tables(0).Columns.Add(dc)

view1 = New DataView(dsInventoryTypeOrders.Tables("Orders"))


Mar 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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:
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.Writeline 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.AutoIncrementStep = -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(dsInventoryTypeOrders.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.OleDbDataAdapter

Dim daOrderDetails As New OleDb.OleDbDataAdapter

Dim test As Int16

'TestConnection()

Console.WriteLine("Test")

Debug.WriteLine("Test")

WriteLine("test")

Try

Dim sql$ = "SELECT 0 AS Selected,
VendorInventoryTypes.VendorInventoryTypesID, VendorInventoryTypes.Code,
VendorInventoryTypes.Category, VendorInventoryTypes.SubCategory,
VendorInventoryTypes.Brand, VendorInventoryTypes.Model,
VendorInventoryTypes.Description, 0 AS Quantity,
VendorInventoryTypes.RequiresUniqueItems,VendorInv entoryTypes.Cost FROM
(VendorInventoryTypes) WHERE (((VendorInventoryTypes.VendorID)=" &
lclVendorID & "));"

daOrders = mdi.dt.GenericDA(sql)

daOrderDetails = mdi.dt.GenericDA(sql)

daOrders.Fill(dsInventoryTypeOrders, "Orders") ' = mdi.dt.GenericDS(sql)

test = dsInventoryTypeOrders.Tables("Orders").Rows.Count

Dim dr As DataRow

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

' Debug.WriteLine(dsInventoryTypeOrders.Tables(0).Co lumns.Count.ToString)

For Each dr In dsInventoryTypeOrders.Tables(0).Rows

Debug.WriteLine(dr.Item("Selected").ToString)

Next

Dim dc As DataColumn

dc.AutoIncrement = True

dc.AutoIncrementSeed = -1

dc.AutoIncrementStep = -1

' dc.Unique = True

dc.ColumnName = "GUID"

dsInventoryTypeOrders.Tables(0).Columns.Add(dc)

view1 = New DataView(dsInventoryTypeOrders.Tables("Orders"))

Mar 15 '06 #2

P: n/a
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" <ja*****@texeme.com> wrote in message
news:44**************@texeme.com...

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:
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.Writeline 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.AutoIncrementStep = -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(dsInventoryTypeOrders.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.OleDbDataAdapter

Dim daOrderDetails As New OleDb.OleDbDataAdapter

Dim test As Int16

'TestConnection()

Console.WriteLine("Test")

Debug.WriteLine("Test")

WriteLine("test")

Try

Dim sql$ = "SELECT 0 AS Selected,
VendorInventoryTypes.VendorInventoryTypesID, VendorInventoryTypes.Code,
VendorInventoryTypes.Category, VendorInventoryTypes.SubCategory,
VendorInventoryTypes.Brand, VendorInventoryTypes.Model,
VendorInventoryTypes.Description, 0 AS Quantity,
VendorInventoryTypes.RequiresUniqueItems,VendorInv entoryTypes.Cost FROM
(VendorInventoryTypes) WHERE (((VendorInventoryTypes.VendorID)=" &
lclVendorID & "));"

daOrders = mdi.dt.GenericDA(sql)

daOrderDetails = mdi.dt.GenericDA(sql)

daOrders.Fill(dsInventoryTypeOrders, "Orders") ' = mdi.dt.GenericDS(sql)

test = dsInventoryTypeOrders.Tables("Orders").Rows.Count

Dim dr As DataRow

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

' Debug.WriteLine(dsInventoryTypeOrders.Tables(0).Co lumns.Count.ToString)

For Each dr In dsInventoryTypeOrders.Tables(0).Rows

Debug.WriteLine(dr.Item("Selected").ToString)

Next

Dim dc As DataColumn

dc.AutoIncrement = True

dc.AutoIncrementSeed = -1

dc.AutoIncrementStep = -1

' dc.Unique = True

dc.ColumnName = "GUID"

dsInventoryTypeOrders.Tables(0).Columns.Add(dc)

view1 = New DataView(dsInventoryTypeOrders.Tables("Orders"))


Mar 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.