473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

are you missing a using directive or an assembly reference

m.a
Hello,

I have the following code which is an entity for a table in my database.
but I am getting several errors such as:

The type or namespace name 'ColumnAttribute' could not be found (are you
missing a using directive or an assembly reference?)

Using the generic type 'System.Data.Linq.Table<TEntity>' requires '1' type
arguments

What is the problem and how can I solve it?

Regards


[Table(Name = "Items")]

public class Items

{

[Column(IsPrimaryKey = true)]

public int Title { get; set; }

[Column]

public string Desc { get; set; }

}
Jul 31 '08 #1
2 24973
On Jul 31, 12:38*pm, "m.a" <m...@spamoff.comwrote:
Hello,

* I have the following code which is an entity for a table in my database.
but I am getting several errors such as:

The type or namespace name 'ColumnAttribute' could not be found (are you
missing a using directive or an assembly reference?)

*Using the generic type 'System.Data.Linq.Table<TEntity>' requires '1' type
arguments

What is the problem and how can I solve it?

Regards

[Table(Name = "Items")]

public class Items

{

[Column(IsPrimaryKey = true)]

public int Title { get; set; }

[Column]

public string Desc { get; set; }

}- Hide quoted text -

- Show quoted text -
The [Column] attribute is not being found, are you using the correct
include directive?
Jul 31 '08 #2
On Thu, 31 Jul 2008 09:38:49 -0700, m.a <ma.@spamoff.comwrote:
[...]
The type or namespace name 'ColumnAttribute' could not be found (are you
missing a using directive or an assembly reference?)

Using the generic type 'System.Data.Linq.Table<TEntity>' requires '1'
type
arguments

What is the problem and how can I solve it?
No doubt, the errors are correct. The first one is very clear about how
to fix it: you are missing either a using directive or assembly reference
(or possibly both).

Without a concise-but-complete code sample, it's not possible to comment
on whether you're missing the using directive. And you'll have to check
yourself to make sure the project includes the necessary reference to the
System.Data.Linq assembly.

Note that this is from LINQ and so you have to be using .NET 3.5.

My guess is that if you resolve the first error, that will address the
second as well.

Pete
Jul 31 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Junior | last post by:
I keep receiving this "The type or namespace name 'CASsEventHandler' could not be found (are you missing a using directive or an assembly reference?)" message in two particular lines, and I've...
1
by: SD WinGirl | last post by:
Is there anyway to programmatically determine which reference assembly to add when the code has a using directive? For example if the code has using System.XML; I need to add a reference to the...
0
by: RSB | last post by:
Hi every one, all of a sudden my project has started giving me the errors about the Reference. here is one example. C:\Projects\myMainFile.ascx.cs(3): A using namespace directive can only be...
0
by: tarscher | last post by:
hi all, My website (ASP .NET) runs on my dev machine but when deploying I get following error: Description: An error occurred during the compilation of a resource required to service this...
4
by: infinetinc | last post by:
I'm receiving the following error when this site is published to the production environment: Compiler Error Message: CS0246: The type or namespace name 'GridViewHelper' could not be found (are you...
5
by: rcoco | last post by:
Hi, I have this program that I'm trying to compile and it flags this error: The type or namespace name 'src' could not be found(are you missing a using directive or an assembly reference?) I've...
0
abehm
by: abehm | last post by:
I renamed a user control from NativeColourCorrected to NativeColour, and rewrote the inherits part on the page code to match the name, but now i get this error: 'The type or namespace name...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
3
by: =?Utf-8?B?QUEyZTcyRQ==?= | last post by:
With using System.Configuration why is ConfigurationManager.AppSettings generate an error? Why does the error resolve itself when, in addition to the using directive, I add a reference...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.