Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way learn VB. NET from 10 years a regular VB guy

Status
Not open for further replies.

DougP

MIS
Joined
Dec 13, 1999
Messages
5,985
Location
US
Argh
I imported a project and got this mess
'UPGRADE_WARNING: Form event Form1.Activate has a new behavior. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup2065"'
Private Sub Form1_Activated(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Activated
Dim WhichDir As Object
Dim DontShutOff As Object

-----------------------
'UPGRADE_WARNING: Couldn't resolve default property of object DontShutOff. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'
DontShutOff = False
'UPGRADE_WARNING: Couldn't resolve default property of object Printroute. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'
If Printroute Then
WhichDrawing = VB.Left(VB.Command(), InStr(1, VB.Command(), "|") - 2) & ".dwg"
Else
WhichDrawing = Trim(VB.Command()) & ".dwg"
--------

It goes on and on

DougP, MCP
 
I've heard several people suggest that the import wizard isn't all it's cracked up to be... they've said that they're only writing new code in .NET and supporting the vb5&6 code until it has to be rewritten from scratch.

Personally, that would be my suggestion to you... a lot of things have changed from VB5&6 to .NET. I personally like it much better... but don't try to upgrade an old project of any magnitude unless you've got a lot of time to work out the stupid little things that the wizard doesn't know how to fix.

I just switched over in November. In that time, I have learned SO much... mostly from posting/reading threads in this forum. Your VB5&6 experience will give you a head start when it comes to syntax; you should be able to fool around in the IDE and learn a lot. If you have specific questions, ask away! With a little time devoted to studying, you'll be up and running in no time at all.
 
DougP -

'UPGRADE_WARNING: Couldn't resolve default property of object DontShutOff.

.NET doesn't support using default properties. When setting properties and calling methods you need to specify them all the way out now. You can't do this anymore:
Code:
MyVar = MyRS.Fields("somecolumn")
You need to do:
Code:
MyVar = MyRS.Fields("somecolumn").Value

Yes, it's going to be a pain to learn the framework. And that's what you ought to concentrate on, not the VB language stuff, as that is almost entirely the same. The framework is where the value is. There was a post here a few months ago where the poster was jumping through hoops -- writing huge amounts of code, making API calls, etc, to do something that was only one line of code to call the framework -- they just didn't know it was there.

Chip H.

 
Sorry to jump in, but where do we start? I've been using VB since 1.x, and BASIC before that...

The .Net help is cryptic at best. It's written for C guys I think.
 
Hi bigfoot,

I won't argue that... "Help" files in most any M$ product do everything except help.

A good way to start is to use what you already know. This includes (a) the interface with the IDE, which (mostly) works the same as VB5&6, and (b) IntelliSense, which has been improved (I think) dramatically.

Create a new project in VB.NET. You'll see a (somewhat) familiar screen, with the form editor showing a blank "Form1". Drag some simple controls on there and play around. Double-clicking a control still brings up the code window. When you're entering code, spend a little time reading the tool-tip text that pops up in the IntelliSense... most of the methods/properties that are exposed in the standard controls make good sense when you read that. Remember what Chip's example above shows: sometimes, you just have to make it explicit (the .Value) above was a good example of this.

When you're comfortable with the interaction (shouldn't take long), pick your poison (database apps, etc) and start asking around in the forums about how to get started. There are a lot of threads already out here (I know, I started them!!!) that deal with how to do XYZ in .NET.

I was uneasy about making the switch... but the framework makes everything SO much easier, I wouldn't go back for all the tea in China. Just change your mindset from "There's an API call to do that" to "There's a function in the framework that will do that".
 
Oh, I'm loving it too, but there is so much to learn. Been at it for a month now, and I think I'm getting it. I got DataSet's down I think. Now I'm fighting with DataGrid's on aspx pages. ;-)

.ToString, and the string functions RULE! Classes are coming slow. Just learned how to get the user of the running program with WindowsPrincipal. We need a roadmap of sorts. A cross reference of all the namespaces and their classes. Can we make our own namespaces? (Imports..)
 
I've seen a couple of threads about namespaces... I've not really needed to create any classes yet, but I'm under the impression that they're basically synonymous with .dlls.

I'm trying to get into web design myself. I wrote a huge desktop app that does a bunch of statistical operations... my users were having to do this stuff literally by hand before; so I'm everyone's favorite right now. <grin>

But anyway, now that we're off-topic... is there anything else we can help you with, Doug?
 
Bigfoot -

The help in .NET is a big improvement, IMO. It does require a little mental shift, however.

What I find works for me is to search on a term I think is close to what I'm looking for. If I can't quite find what I'm looking for, I click on one of the search results anyway, and then scroll down to the bottom to the &quot;See Also&quot; section and click on the namespace to get a list of related classes. Hopefully I can spot it there.

Once I locate the class that will do what I want, I click on the &quot;about xxxxx class&quot; in the Index to learn how it's used. Or the &quot;all members&quot; to see what properties/methods it exposes. If the method has overloads, I click on it, and then the particular overload that might meet my needs.

One concept that takes a little getting used to is how the help handles collections. You could be on HttpRequest, looking at the ServerVariables property. You click on it, and see that it returns a NameValueCollection. You then have to click on that link to drill down further to find out what properties/methods that the NameValueCollection offers. Just takes a couple of more mouse clicks, but actually it's well-organized.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top