Click here to Skip to main content
11,641,067 members (58,071 online)
Rate this: bad
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
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
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.

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

  Print Answers RSS
0 Mika Wendelius 400
1 OriginalGriff 205
2 DamithSL 203
3 CPallini 145
4 Afzaal Ahmad Zeeshan 129
0 Mika Wendelius 380
1 OriginalGriff 205
2 DamithSL 203
3 CPallini 125
4 Afzaal Ahmad Zeeshan 89

Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2015
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