sqlmetal.exe returns Using the generic type 'System.Data.Linq.Table' requires 1 type arguments

641 views Asked by At

I am using sqlmetal.exr to generate the mapping code for me. I am calling sql metal by using.

cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
SqlMetal.exe /server:servername\SQL /database:mydb /code:mycode.cs

The output is a cs file and the command promt says:

Microsoft (R) Database Mapping Generator 2008 version 1.00.30729 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved.

When I add the file to my project and try to build it I get the following error:

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

This is in my mycode.cs file. I am referencing System.Data.Linq and System.Data. What referennce is missing to get this to work?

Update

Make sure you have System.Data.Linq in your GAC and that the assembly version is 3.5.0.0. Also make sure that's the version your project is referencing.

enter image description here

enter image description here

Double-check that your application's target framework hasn't somehow been changed to something other than 3.5. The Linq To SQL features only work with the 3.5 framework.

enter image description here

1

There are 1 answers

2
MethodMan On BEST ANSWER

if the problem persist here are a list of things you can try to resolve the issue

A few things to check/try:

  • Make sure you have System.Data.Linq in your GAC and that the assembly version is 3.5.0.0. Also make sure that's the version your project is referencing.

  • When you look at the project references is there a yellow "!" icon next to the reference? If so, that indicates that the version of System.Data.Linq your project references is not being found by VS. You should try deleting the reference and adding a new one.

  • Double-check that your application's target framework hasn't somehow been changed to something other than 3.5. The Linq To SQL features only work with the 3.5 framework.