Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
i get this error:
The type or namespace name 'HwMangementDataContext' could not be found (are you missing a using directive or an assembly reference?)
 
i just set the primary key of all tabel to onInsert and add this property to one column
 
DbType = "UniqueIdentifier NOT NULL"
Posted 30-May-12 23:08pm
Edited 31-May-12 7:27am
RyanDev108.8K
v2
Comments
Rajesh Kariyavula at 31-May-12 5:11am
   
Have you created the DataContext manually or its automatically created on providing the DataSource. And how many DataContexts you have?
parisa heidari at 31-May-12 9:40am
   
i create it manually an i have one datacontext.
ryanb31 at 31-May-12 13:28pm
   
EDIT: removed pre tags.
Rajesh Kariyavula at 31-May-12 13:38pm
   
Can you share the code on how you are initializing the DataContext...And there is a problem which I have faced, even I have created DataContext Manually and when you want to update the DataContext with the DataSource then all you modifications will be reverted and will be set as per the DataSource. So my advice once you create a DataContext never update it through a DataSource, you have to do it manually.
parisa heidari at 31-May-12 15:35pm
   
Thank you for helping.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are getting the same error after adding the reference manually, then try the below solution:
 
Check your build types of each project under project properties - I bet one or the other will be set to build against .NET XX - Client Profile.
 
With inconsistent versions, specifically with one being Client Profile and the other not, then it works at design time but fails at compile time. A real gotcha.
 
There is something funny going on in Visual Studio 2010 for me, which keeps setting projects seemingly randomly to Client Profile, sometimes when I create a project, and sometimes a few days later. Probably some keyboard shortcut I'm accidentally hitting.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 235
1 OriginalGriff 215
2 Manfred R. Bihy 190
3 CHill60 180
4 _Amy 155
0 OriginalGriff 7,395
1 Sergey Alexandrovich Kryukov 6,163
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,702


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100