Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Website Programming Problem Design Solution
This is the forum to discuss the Wrox book ASP.NET 3.5 Website Programming Problem Design Solution by Chris Love; ISBN: 978-0-470-18758-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Website Programming Problem Design Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 20th, 2010, 10:44 AM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# to VB

I am a VB developer and attempting to move this code into VB as I move along for following purposes.... Although I am starting to think maybe I should just learn C# and go with the book...

How would I convert this to VB? I am on page 66 of the book

The next step is to create the Data class that will manage the entity objects. Ideally, these would be
static classes with all static methods, but we want to ensure that they all implement certain abstract
methods so we’re limited to creating an abstract class with instance methods. To accomplish this,
right-click on the Framework folder and select Add New Item. Add a new class module and name it
ENTBaseData. It looks like this:
public abstract class ENTBaseData<T> where T : IENTBaseEntity
{
public abstract List<T> Select();
public abstract T Select(int id);
public abstract void Delete(HRPaidTimeOffDataContext db, int id);
public void Delete(string connectionString, int id)
{
using (HRPaidTimeOffDataContext db = new
HRPaidTimeOffDataContext(connectionString))
{
Delete(db, id);
}
}
}
  #2 (permalink)  
Old July 26th, 2010, 12:48 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I'm not sure about converting the code, because I know there are some subtle differences between the implementation of VB and C# generics.

I orginally started out in VB, and found the transition to C# very easy. Plus, I know that it is simply a matter of style, but the structure of braces in C# melds more naturally and visually with the way I like to structure my code, so I find I'm able to code more fluidly with less distractions and spend more time focusing on things that really matter instead of syntax and interpreting my code.

However, especially since you're working with stuff beyond the beginning level of generics, that's probably another reason to learn C# in this case, because you won't have creepy little problems that crop up in your code just because VB and C# handle some things in generics a bit differently.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
  #3 (permalink)  
Old July 26th, 2010, 06:07 PM
Registered User
 
Join Date: Jul 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I decided to take the plunge and follow along in c#. I am finding it difficult just because visual basic is more "english sounding" which to me is more intuitive. But I will get it.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a VB 2005 exe file on a system without VB dilionyi Pro Visual Basic 2005 3 September 21st, 2009 07:37 PM
VB.NET 2003 Appendix B convert to VB 2008 Express Edition brucechess BOOK: Beginning VB.NET Databases 10 February 5th, 2009 12:52 PM
How do I write this vb 6 code to work in vb 2008? sanderson Visual Basic 2008 Essentials 3 June 10th, 2008 01:46 PM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
VB.Net/VB/Access97/Access2002 Comparison doveb VB.NET 4 October 10th, 2003 09:54 AM



All times are GMT -4. The time now is 07:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.