Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

mixed cs/vb question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WebBuilder451 - 13 Sep 2007 15:42 GMT
I have a site wher ei'm using both cs and vb helper classes and it's working
ok (please the, "why would you want to do that"  comment is unnecessay;
"stuff" happens and you need to play the hand you are delt).

However, i need to access some methods in a cs class from a vb class. Does
anyone know how to do this?

Thanks!
Signature

(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes

Anthony Jones - 13 Sep 2007 16:12 GMT
> I have a site wher ei'm using both cs and vb helper classes and it's working
> ok (please the, "why would you want to do that"  comment is unnecessay;
> "stuff" happens and you need to play the hand you are delt).
>
> However, i need to access some methods in a cs class from a vb class. Does
> anyone know how to do this?

Have you tried adding the microsoft.visualbasic.dll to a C# project?

BTW, despite you're preamble, why??

Signature

Anthony Jones - MVP ASP/ASP.NET

WebBuilder451 - 13 Sep 2007 20:36 GMT
actually i did that when i was learning cs because i got frustrated one day.
they are both in the same project and working ok i can instate a cs class in
a vb or cs page.
as to why? i didn't want ot rewrite 20 or 30 functions for simple CRUD
operations.

Signature

(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes

> > I have a site wher ei'm using both cs and vb helper classes and it's
> working
[quoted text clipped - 7 lines]
>
> BTW, despite you're preamble, why??
Siva M - 13 Sep 2007 16:14 GMT
Assuming you have both C# and VB code in their own projects (in a solution,
likely):

1. Make the CS class and method both public
2. Add a project reference to the CS project from VB.NET project

And you all set to instantiate/access the C# class/method...

Hope this helps?

> I have a site wher ei'm using both cs and vb helper classes and it's working
> ok (please the, "why would you want to do that"  comment is unnecessay;
[quoted text clipped - 4 lines]
>
> Thanks!
Peter Bromberg [C# MVP] - 13 Sep 2007 18:46 GMT
If you really like c#, then simply consider translating the Vb.NET class to
c# and be done with it.
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> I have a site wher ei'm using both cs and vb helper classes and it's working
> ok (please the, "why would you want to do that"  comment is unnecessay;
[quoted text clipped - 4 lines]
>
> Thanks!
WebBuilder451 - 13 Sep 2007 20:38 GMT
yes i thought of that, believe it or not, will not help the other developers
working on the project, and it'd be work.
Signature

(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes

> If you really like c#, then simply consider translating the Vb.NET class to
> c# and be done with it.
[quoted text clipped - 12 lines]
> >
> > Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.