Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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);
}
}
}
 
Old July 26th, 2010, 12:48 PM
Friend of Wrox
 
Join Date: Jun 2007
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.
 
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.





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.