Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 December 10th, 2009, 02:28 PM
Authorized User
 
Join Date: Nov 2009
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Default Class Clash

If this question/observation goes outside the scope of the book, just ignore it, but I find this interesting. I am trying to use the techniques demonstrated in the book to my own project.

I defined a class that mirrored the structure of a table, with some constructors and get/sets - nothing more. The class file existed in the project but not otherwise in use.

Later, I created a linq to Sql class and on the table and brought up the Object Relational Designer when a whole pile of runtime errors occurred referencing my class file - all about duplicate constructors and name clashes.

I am assuming that the linq to sql class setup created some source code very similar to my own? Does that mean having my hand coded class and a linq to sql class are mutually exclusive?
 
Old December 11th, 2009, 11:11 AM
Authorized User
 
Join Date: Nov 2009
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Default

Got it now.
 
Old December 12th, 2009, 06:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Sorry for my late reply. Bit busy....

Anyway, glad you figured it out. What did you do? Put your class in a separate namespace so the two don't clash anymore?

If you want to extend the class that is defined by L2S, you can also create a partial class with the same name and namespace as the L2S class. E.g.:

public partical class Picture {}

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing an event from a class to the class that created it? dcellis1950 Visual C++ 3 October 6th, 2009 11:14 AM
type clash: sql_variant is incompatible with text l_ali_khan VB Databases Basics 0 April 2nd, 2007 11:02 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM





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