Click here to Skip to main content
12,815,120 members (36,842 online)
Rate this:
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 31-May-12 0:08am
Updated 31-May-12 8:27am
Rajesh Kariyavula 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 31-May-12 9:40am
i create it manually an i have one datacontext.
ryanb31 31-May-12 13:28pm
EDIT: removed pre tags.
Rajesh Kariyavula 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 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
Top Experts
Last 24hrsThis month

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