views:

54

answers:

2

Iam using LINQ To SQL with POCO's and XML mapping. I am getting the following error when I try to run the application: Cannot find type 'MyProject.DataTransfer.User' from mapping. Below is the mapping:

<Table Name="Users" Member="User">
        <Type Name= "MyProject.DataTrasnfer.User">
            <Column Name="UserID" Member="UserID" DbType="Int NOT NULL IDENTITY" IsDbGenerated="true"
            IsPrimaryKey="true"/>
            <Column Name="UserName" Member="UserName" DbType="nvarchar(100) NOT NULL" />
            <Column Name="Password" Member="Password" DbType="nvarchar(32)"/>
            <Column Name="IsActive" Member="IsActive"  DbType="bit NOT NULL"/>
            <Column Name="InsertedBy" Member="InsertedBy" DbType="Int NOT NULL" />
            <Column Name="InsertedDate" Member="InsertedDate" DbType="DateTime NOT NULL" />
            <Column Name="UpdatedBy" Member="UpdatedBy" DbType="Int NOT NULL" />
            <Column Name="UpdatedDate" Member="UpdatedDate" DbType="DateTime NOT NULL" />
            <Column Name="Version" Member="Version" DbType="rowversion NOT NULL" IsDbGenerated="true"
             IsVersion="true" AutoSync="Always"/>
        </Type>
    </Table>

But 'MyProject.DataTransfer.User' exists in the solution. What could be the possible reasons for this error?

A: 

I suppose that you have a class MyProject.DataTraSNfer.User in mapping and MyProject.DataTraNSfer.User in code. Misprint in post or in code?

Devart
+1  A: 

Typo: MyProject.DataTrasnfer.User. You have transposed the s and the n.

Jason