By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

are you missing a using directive or an assembly reference

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.