Erratic debugging behavior / WriteLine won't work.

R

Rico

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,VendorInventoryTypes.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).Columns.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"))
 
J

John Bailo

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.
 
R

Rico

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) ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top