Help for a VB.Net guy

H

Harry Strybos

Hi All

I am trying to learn how to use C# from a VB.Net programmer angle.

Can some kind soul give me an example of how to raise an event in C# as in
VB.Net "RaiseEvent ErrorMsg(ErrMsg As String) and also how to implement
IDisposable in a C# class.

Sorry about the large request. I am very confused with all the examples I
find.

Thanks for any help

Harry
 
P

Peter Duniho

Hi All

I am trying to learn how to use C# from a VB.Net programmer angle.

Can some kind soul give me an example of how to raise an event in C# as
in
VB.Net "RaiseEvent ErrorMsg(ErrMsg As String)

Search text for MSDN: "C# event". Second hit:
http://msdn.microsoft.com/en-us/library/awbftdfh.aspx
(the first hit is probably useful too, but the second one is more current)
and also how to implement IDisposable in a C# class.

Search text for MSDN: "implementing IDisposable". Found on the first page:
http://msdn.microsoft.com/en-us/library/b1yfkh5e.aspx

You have to dig a tiny bit more to find that article, but not much (it's
the seventh hit in this case). And the preceding hits from the search
aren't exactly wrong; they are, again, simply not the most current
articles.

Pete
 
H

Harry Strybos

Peter Duniho said:
Search text for MSDN: "C# event". Second hit:
http://msdn.microsoft.com/en-us/library/awbftdfh.aspx
(the first hit is probably useful too, but the second one is more current)


Search text for MSDN: "implementing IDisposable". Found on the first
page:
http://msdn.microsoft.com/en-us/library/b1yfkh5e.aspx

You have to dig a tiny bit more to find that article, but not much (it's
the seventh hit in this case). And the preceding hits from the search
aren't exactly wrong; they are, again, simply not the most current
articles.

Pete
Hi Pete

Thanks for the help. I will check it out.

VB.Net makes the stuff I asked about very simple, however, I am starting to
really like a lot of stuff about C# as well. My thinking is that it is worth
the effort to understand C# as so many examples are in this language.
I have added a C# project to our main company application (VB.Net) so that I
can write new utilities in C#. The first one was to connect to a web service
to send SMS messages. I got it to work but wanted to add IDisposable to use
"using" and also wanted to raise an error event. Lot of stuff to learn there
in C#.

Nice to be able to mention another language without being flammed (as in the
old VB6 group)

Cheers
 
P

Peter Duniho

[...]
Nice to be able to mention another language without being flammed (as in
the
old VB6 group)

I think you'll find that many of the C# programmers here use VB.NET on at
least a semi-regular basis. Of the remainder (including me), people
generally recognize that different programming languages are suitable for
different needs. We all have our preferences and biases, of course (for
example, there are in fact things in VB.NET I don't like, but other things
I wish were in C#), but given that VB.NET and C# are targeting the exact
same framework, and so you can do practically identical things in each
language, there's little basis for severe criticism. :)

Pete
 
H

HS

Hello Harry

Just wanted to chime in with some good advice. Do as much C# as you can
while working for a company so that you can honestly say i've got so many
years of C# while working for an employer.
I was laid off from my job in March where I made in the mid eighties writing
VB.NET code.....I worked up to a Senior Programmer level. Now that I'm
looking again for another developer position, I'm finding that all jobs
require C# and they act like my 9+ years of VB.NET is worthless....I am
looking at having to take a 13k+ cut in salary and enter the market as a
junior programmer if that is even possible.
Companies have bought the C# preference promoted by Microsoft and it's
killing VB.NETers out here during this recession. I now have realized that
my company did me a huge disservice by not letting me "switch" to C# years
ago when i suggested it.
Bottom line learn C# as I am doing too. VB.NET at least in Nashville TN is
dead.
All the Best
Harry Simpson
(e-mail address removed)
 
J

Jeff Johnson

I was laid off from my job in March where I made in the mid eighties
writing VB.NET code.....

You were writing VB.NET code in the mid-80's? Talk about being ahead of the
curve....
 

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