-1
votes
0answers
9 views

Trying to make a For Loop that adds something in Visual Basic; not getting right answer [migrated]

I need to make a console app for a class, and it has to compute the following using a For Next loop: 4 + 8 + 12 + 16 + 20 .... + 208 Here's what I have: Dim x As Integer = 0 Dim z As Integer = 4 ...
3
votes
1answer
361 views

Why doesn't VB.NET allow unnamed, one-line objects to be used?

Why isn't this allowed in VB.NET: New SqlCommand("some string", someSqlConnection).ExecuteNonQuery() Why would the language have been designed to require that this be used instead: Dim com As New ...