When I add a database table to a DBML file via LINQ to SQL, I get a slew of compiler errors.

Posted by Zian Choy on Stack Overflow See other posts from Stack Overflow or by Zian Choy
Published on 2010-05-06T00:40:17Z Indexed on 2010/05/06 0:48 UTC
Read the original article Hit count: 441

Filed under:
|

Whenever I add a certain table to a DBML file via LINQ to SQL, I get 102 errors in my VB NET project.

Some of the errors:

Error   1   Attribute 'TableAttribute' cannot be applied multiple times.    C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 74  2   EMS Reality Check
Error   2   'emptyChangingEventArgs' is already declared as 'Private Shared emptyChangingEventArgs As System.ComponentModel.PropertyChangingEventArgs' in this class.   C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 78  17  EMS Reality Check
Error   3   '_GroupID' is already declared as 'Private _GroupID As Integer' in this class.  C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 80  10  EMS Reality Check
Error   4   '_ID' is already declared as 'Private _ID As Integer' in this class.    C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 82  10  EMS Reality Check

Any suggestions for getting the table to work with LINQ to SQL will be welcomed.

The table's properties:

Group ID
ID (Primary Key)
Contact
Title
UseGroupAddress
InternationalFormat
Address1
Address2
City
State
ZipCode
Country
Phone
Fax
EMailAddress
Notes
DateAdded
AddedBy
DateChanged
ChangedBy
Active
ExternalReference
ChangeCounter
PhoneLabel
FaxLabel

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about vb.net