New to .NET

J

Jack Leach

Hello and thanks in advance...

I've download Visual Basic 2008 Express edition with the intent to create
some glorified calculators, and was wondering if someone may be able to
supply any links or recommended books for learning the basics of VB.

I'm (fairly) fluent in VBA, having written a few data management
applications with MS Access, so I'm not a complete dunce with programming.

Aside from that, there's two things I'm wondering about at the moment, maybe
someone could help with (building a labor cost calculator):

1) Datatypes for text in a textbox... With VBA in Access, a bound textbox
is set to a specific datatype. My textboxes in VB are unbound, and therefor
do not seem to have a specific datatype (they all default to a string?). Is
there a default setting that I can use to make sure that a numberic value is
entered into the textbox, or do I need to check validate this using the
IsNumeric function for each textbox...

2) Formats in a textbox... in my control txtLaborRate, I would like this to
be formatted as currency. I perused the properties of the control but
haven't come across anything I recognize to set a default format. So I tried
putting some code behind the control using the
FormatCurrency(Me.txtLaborRate.Text) function, but haven't gotten the results
I was looking for. In the meantime I'll continue playing around with it.

Any help would be great!

Thanks,


--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
S

Scott M.

There are many books out there, but I like "Professional Visual Basic 2008"
by Bill Evjen, et all. WROX.

As an IT technical trainer that myself came from a VBA/VB 6 background when
..NET first came out, I can tell you to forget everything you know about VB
6/VBA. VB .NET is 200% different. Learning it will require an
understanding of the underlying Framework that your code is actually
executed within (the .NET Framework).

In my experience with .NET since its early betas, I've seen time and time
again folks who are coming from VB 6/VBA backgrounds and have seen some VB
..NET and recognize some of the syntax and believe that VB .NET just has some
new stuff added to what they already know. This couldn't be farther from
the truth. Because of that, your two questions below don't really have any
meaning in .NET.

..NET doesn't use "data types" like VB/VBA used to. Everything is an object
of one type or another. Textboxes hold String object data, period. They
show the String object data you give them. If you want that String object
data formatted, you don't format the textbox, you format the data.

Be prepared to throw everything you know about VBA out and to start learning
from scratch. The minute you make an assumption that something works the
same in .NET as it did in VBA is the minute that your code won't work as it
should.

-Scott
 
J

Joe Cool

Hello and thanks in advance...

I've download Visual Basic 2008 Express edition with the intent to create
some glorified calculators, and was wondering if someone may be able to
supply any links or recommended books for learning the basics of VB.

I'm (fairly) fluent in VBA, having written a few data management
applications with MS Access, so I'm not a complete dunce with programming..

Aside from that, there's two things I'm wondering about at the moment, maybe
someone could help with (building a labor cost calculator):

1) Datatypes for text in a textbox...  With VBA in Access, a bound textbox
is set to a specific datatype.  My textboxes in VB are unbound, and therefor
do not seem to have a specific datatype (they all default to a string?).  Is
there a default setting that I can use to make sure that a numberic valueis
entered into the textbox, or do I need to check validate this using the
IsNumeric function for each textbox...

2) Formats in a textbox...  in my control txtLaborRate, I would like this to
be formatted as currency.  I perused the properties of the control but
haven't come across anything I recognize to set a default format.  So Itried
putting some code behind the control using the
FormatCurrency(Me.txtLaborRate.Text) function, but haven't gotten the results
I was looking for.  In the meantime I'll continue playing around with it.

Any help would be great!

Thanks,

I know it is blashphemous to say something like this on this
newsgroup, but I would strongly suggest you use C#.NET instead of
VB.NET. I started out with VB.NET so I know the differences between
them, and C#.NET is much easier to use, IMHO.
 
D

DickGrier

Also, take a look at the VB Developer Center/Learn
(http://msdn.microsoft.com/en-us/vbasic/ms789086.aspx). There are examples,
videos, walkthrough's, etc.

Dick

--
Richard Grier (Microsoft MVP - Visual Basic) Hard & Software 12962 West
Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) Homepage:
www.hardandsoftware.net Author of Visual Basic Programmer's Guide to Serial
Communications, 4th Edition ISBN 1-890422-28-2 (391 pages) published July
2004, Revised July 2006.
 
S

Scott M.

Here we go....

Saying C# is much easier is really an extremely subjective thing to say. I
started out with VB and now use and teach both and I believe that VB is
easier. While each language has its own "features", they are functionally
equivelent since they both compile down to the same IL.

Which language you choose is simply a matter of preference. C# is a C-like
language, which some people appreciate. Others (myself included) find the
lack of keywords, the case sensitivity, and the extensive use of curly
braces and semicolons to be annoying, at best.

-Scott

Hello and thanks in advance...

I've download Visual Basic 2008 Express edition with the intent to create
some glorified calculators, and was wondering if someone may be able to
supply any links or recommended books for learning the basics of VB.

I'm (fairly) fluent in VBA, having written a few data management
applications with MS Access, so I'm not a complete dunce with programming.

Aside from that, there's two things I'm wondering about at the moment,
maybe
someone could help with (building a labor cost calculator):

1) Datatypes for text in a textbox... With VBA in Access, a bound textbox
is set to a specific datatype. My textboxes in VB are unbound, and
therefor
do not seem to have a specific datatype (they all default to a string?).
Is
there a default setting that I can use to make sure that a numberic value
is
entered into the textbox, or do I need to check validate this using the
IsNumeric function for each textbox...

2) Formats in a textbox... in my control txtLaborRate, I would like this
to
be formatted as currency. I perused the properties of the control but
haven't come across anything I recognize to set a default format. So I
tried
putting some code behind the control using the
FormatCurrency(Me.txtLaborRate.Text) function, but haven't gotten the
results
I was looking for. In the meantime I'll continue playing around with it.

Any help would be great!

Thanks,

I know it is blashphemous to say something like this on this
newsgroup, but I would strongly suggest you use C#.NET instead of
VB.NET. I started out with VB.NET so I know the differences between
them, and C#.NET is much easier to use, IMHO.
 
J

Jack Leach

Thanks for the feedback. My favorite VBA book was published by WROX as well,
and I've been through a few, so I'll take a look at this one, they seem to do
well.

I have taken a peek at the framework in the past, but it is very foreign to
me. I'm not quite sure where to start (or wasn't about a year ago when I got
curious about it). I'll take your advice and try my best to keep these two
languages seperate (I've seen many articles, etc., describing the
similarities or differences between VBA and .NET, and have gotten the
impression that they are acutally nothing alike, despite some people's
attempts to make it seem so. Hearing this from someone who has been through
it takes a lot of the question of how much I can rely on already knowing).

Thanks,

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
J

Jack Leach

Thanks, I'll take a look at this. .NET is such a powerful subject its
difficult to tell where to start, being that I don't have any major intention
of using it to it's full capability (even my VBA/Access programming is
self-taught and more of hobby than career...)

I shall wade through it!

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
J

Jack Leach

Might you be able to describe some of the core differences between the two?
Years and years ago I used to dabble with C++ (borland...), and have always
wondered what the differences are in these newer languages.

What is C# capable of, or more catered to, than VB? Is there a particular
"type" of applications that one or the other is more suited for? For that
matter, how about other versions of C?

My long term interest in switching from Access VBA to (some other language)
is to be able to manage data without needing the host application of Access,
and because I am seriously stretching the limits of VBA. But, by no means do
I ever expect to be a "real" developer (I don't do this for a living and only
have so much free time to spend with it).


Any further insight you might be able to offer would be greatly
appreciated... at this point I am very open to the possibility of using a
different language if it will pay off in the long run.

Thanks,

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
S

Scott M.

Jack Leach said:
Might you be able to describe some of the core differences between the
two?
Years and years ago I used to dabble with C++ (borland...), and have
always
wondered what the differences are in these newer languages.

What is C# capable of, or more catered to, than VB? Is there a particular
"type" of applications that one or the other is more suited for? For that
matter, how about other versions of C?

Nothing. The two languages compile down to the same Intermediate Lanaguage
code, use the same type system, and follow the same language specification.
The one you choose is simply based on the style of coding you prefer,
nothing more, nothing less.
My long term interest in switching from Access VBA to (some other
language)
is to be able to manage data without needing the host application of
Access,
and because I am seriously stretching the limits of VBA. But, by no means
do
I ever expect to be a "real" developer (I don't do this for a living and
only
have so much free time to spend with it).


Any further insight you might be able to offer would be greatly
appreciated... at this point I am very open to the possibility of using a
different language if it will pay off in the long run.

That's what makes .NET great, the language you choose won't cause you to
code yourself into a corner.

-Scott
 
M

Mike Williams

That's what makes .NET great, the language you choose
won't cause you to code yourself into a corner.

They're all driving you into a corner, it's just the same corner, that's all
;-)

Mike
 
T

Tom Shelton



Not exactly true. There are features unique to both languages, and there are
places where one or the other are more suitable because of that...

For instance, try and do some complex office automation using C# and late
binding... Generate complex xml documents, etc.

Or, try to create a custom iterator in VB.NET. Or use a function that takes an
action predicate (does not return a value) - for instance List(Of T).ForEach.
Or try and directly manipulate memory.

Some of these diferences are going to be resolved in the VS2010 version of the
the two langauges - but, as of today there are definate circumstances where
one is clearly superior to the other....
 
J

Jack Leach

Thanks again Scott, you've been a great help.



Scott M. said:
Nothing. The two languages compile down to the same Intermediate Lanaguage
code, use the same type system, and follow the same language specification.
The one you choose is simply based on the style of coding you prefer,
nothing more, nothing less.


That's what makes .NET great, the language you choose won't cause you to
code yourself into a corner.

-Scott
 
B

Brian Gideon

Might you be able to describe some of the core differences between the two?  
Years and years ago I used to dabble with C++ (borland...), and have always
wondered what the differences are in these newer languages.

What is C# capable of, or more catered to, than VB?  Is there a particular
"type" of applications that one or the other is more suited for?  For that
matter, how about other versions of C?

My long term interest in switching from Access VBA to (some other language)
is to be able to manage data without needing the host application of Access,
and because I am seriously stretching the limits of VBA.  But, by no means do
I ever expect to be a "real" developer (I don't do this for a living and only
have so much free time to spend with it).

Any further insight you might be able to offer would be greatly
appreciated... at this point I am very open to the possibility of using a
different language if it will pay off in the long run.

Thanks,

--

C# and VB.NET use the same underlying framework and as such can be
used interchangably between many different kinds of application. The
following wikipedia article provides a good overview of the
differences.

http://en.wikipedia.org/wiki/Comparison_of_C_sharp_and_Visual_Basic_.NET
 
T

Tom Shelton

Here we go....

Saying C# is much easier is really an extremely subjective thing to say. I
started out with VB and now use and teach both and I believe that VB is
easier. While each language has its own "features", they are functionally
equivelent since they both compile down to the same IL.

Those features make some tasks easier in on language over the other - further,
there is no comparison between the IDE's. C#'s IDE experience is vastly
superior. I can give you numerous day-to-day examples that make any of my
uses of VB.NET a frustrating experience.
Which language you choose is simply a matter of preference. C# is a C-like
language, which some people appreciate.

I like C :)
Others (myself included) find the
lack of keywords, the case sensitivity, and the extensive use of curly
braces and semicolons to be annoying, at best.

I have to ask - what do you mean lack of keywords? C# has lots of keywords -
just no concept of intrinsic functions.

As for the rest, yes syntax is a personal thing.
 
S

Scott M.

Tom Shelton said:
Those features make some tasks easier in on language over the other -
further,
there is no comparison between the IDE's. C#'s IDE experience is vastly
superior. I can give you numerous day-to-day examples that make any of my
uses of VB.NET a frustrating experience.

....And, that's why I said "here we go"!

I would say that C# offers MUCH better native refactoring support, but to
say that the IDE is VASTLY superior for C# is hardly true. I can counter
with many situations where the IDE offers features while coding in VB that
it does not for C#. Further, going forward (with VS 2010), we'll see much
tighter integration between VB and C# language and IDE features as those 2
teams are now being managed by one person with just this goal in mind.
I like C :)

I have to ask - what do you mean lack of keywords? C# has lots of
keywords -
just no concept of intrinsic functions.

I mean that some say VB is verbose because of its desire for everything to
be declared/labled as to what it is (Sub, Funciton, Overrides, Overloads,
Shared, etc.). Yes, C# has keywords. As to the intrinsic functions, I
assume you are referring to the legacy VB 6 functions that have made their
way into the VB .NET language...Well, that's another hot thread, but I don't
consider them part of the langauge (although I know that technically they
are) and don't use them.
 
S

Scott M.

Tom Shelton said:
On 2009-08-13, Scott M. <[email protected]> wrote:
Some of these diferences are going to be resolved in the VS2010 version of
the
the two langauges - but, as of today there are definate circumstances
where
one is clearly superior to the other....

I did say that each language has features that the other didn't. But, that
does not make one language better suited to code with than the other. And,
as you point out this is a shrinking point anyway.
 
J

Joe Cool

Here we go....

Saying C# is much easier is really an extremely subjective thing to say.  I
started out with VB and now use and teach both and I believe that VB is
easier.  While each language has its own "features", they are functionally
equivelent since they both compile down to the same IL.

More opinion: What makes VB easier than C# is that it automatically
casts everything for you. But that is also dangerous.
Which language you choose is simply a matter of preference.  C# is a C-like
language, which some people appreciate.  Others (myself included) find the
lack of keywords, the case sensitivity, and the extensive use of curly
braces and semicolons to be annoying, at best.

Yet more opinion: I think the case INsensitive nature of VB is
restrictive in naming objects and variables. I like to be able to have
two object/variable names of Document and document and they represent
two toatally different variables/objects.
 
M

Mr. Arnold

Jack Leach said:
Hello and thanks in advance...

I've download Visual Basic 2008 Express edition with the intent to create
some glorified calculators, and was wondering if someone may be able to
supply any links or recommended books for learning the basics of VB.

I'm (fairly) fluent in VBA, having written a few data management
applications with MS Access, so I'm not a complete dunce with programming.

Aside from that, there's two things I'm wondering about at the moment,
maybe
someone could help with (building a labor cost calculator):

1) Datatypes for text in a textbox... With VBA in Access, a bound textbox
is set to a specific datatype. My textboxes in VB are unbound, and
therefor
do not seem to have a specific datatype (they all default to a string?).
Is
there a default setting that I can use to make sure that a numberic value
is
entered into the textbox, or do I need to check validate this using the
IsNumeric function for each textbox...

The textbox control has a Keypress event where you can place code to accept
keys or reject keys, like only accept numeric keys and keys like ',' or '.'
and reject alpha keys.

There are plenty of coding examples on Goggle and Bing that you can pillage
and plunder on a whole lot things on the howto(s) by searching. You say
you're an experienced programmer, so you should be able to find the examples
and run with them.
2) Formats in a textbox... in my control txtLaborRate, I would like this
to
be formatted as currency. I perused the properties of the control but
haven't come across anything I recognize to set a default format. So I
tried
putting some code behind the control using the
FormatCurrency(Me.txtLaborRate.Text) function, but haven't gotten the
results
I was looking for. In the meantime I'll continue playing around with it.

Any help would be great!

You have the Format command itself or the ToString() to format currency
text.

This stuff works in VB or C#.NET the same way it makes no difference.

http://www.willasrari.com/blog/net-tostring-method-for-formatting-currency/000159.aspx
http://blog.stevex.net/index.php/string-formatting-in-csharp/



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4333 (20090813) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
T

Tom Shelton

...And, that's why I said "here we go"!

LOL... I know.
I would say that C# offers MUCH better native refactoring support, but to
say that the IDE is VASTLY superior for C# is hardly true. I can counter
with many situations where the IDE offers features while coding in VB that
it does not for C#. Further, going forward (with VS 2010), we'll see much
tighter integration between VB and C# language and IDE features as those 2
teams are now being managed by one person with just this goal in mind.

Do you want the list of annoyances? Please, I'd like to know where you think
the VB IDE is better - since I've never encountered a place where that was
true :)

As for merging... Well, if the current VS2010 preview is any indication, not
much is changing as far as the ide. VB.NET's still sucks in comparison. And
even with the brave new linq world they haven't given a easy way to create
custom iterators :)
I mean that some say VB is verbose because of its desire for everything to
be declared/labled as to what it is (Sub, Funciton, Overrides, Overloads,
Shared, etc.). Yes, C# has keywords. As to the intrinsic functions, I
assume you are referring to the legacy VB 6 functions that have made their
way into the VB .NET language...Well, that's another hot thread, but I don't
consider them part of the langauge (although I know that technically they
are) and don't use them.

Understand, I'm not saying that the intrinsice VB language functions do not
have merrit (though, I do tend to avoid the file io functions and almost all
of the my crap). They are part of the language and certainly can be used :)
 
B

Brian Gideon

And
even with the brave new linq world they haven't given a easy way to create
custom iterators :)

Uggg...I hate that too. And the lambda expression syntax in VB.NET
sucks compared to C# as well.
 

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