locked
System.Data.Linq.Mapping missing ?

    Question


  • Hello everyone Smile

    I use visual C# express and I need to do some SQL to object mapping...
    It seems I can't find System.Data.Linq.Mapping to define my Table and Column attributes...
    I looked at my references and only found System.Data.Linq...
    Is this a disabled feature for visual C# express ?
    Thanks Smile

    Saturday, May 31, 2008 6:48 PM

Answers

  • It's difficult to say it but... I'm an idiot.

    Actually, the solution has two projects... Yes, the reference was added.. but on the wrong project...

    Thank you for the help Smile

     

    Saturday, May 31, 2008 8:54 PM

All replies

  • Add a reference to System.Data.Linq.Mapping  assembly, then import the namespace and you should have access to the classes in that namespace

     

    so right click on your references in your project in solution explorer > add "System.Data.Linq" .NET assembly then...

     

    System.Data.Linq.Mapping is the namespace Smile

     

    Remember, this is available in VS Express 2008 since this is a .NET 3.5 feature

    Saturday, May 31, 2008 7:00 PM

  • I have VS Express 2008... but I don't have that reference unfortunately...
    There is System.Data.Linq, which I already added... but no System.Data.Linq.Mapping
    Any idea why this may be ?

    Thank you Smile
    Saturday, May 31, 2008 7:08 PM
  • odd because I can see itSmile

     

     

    I did this:

     

    new project

    right click "references" > Add reference

    Selected System.Data.Linq

     

    then in code:

     

    using System.Data.Linq.Mapping;

     

    in the using Declerations, and was able to see the classes in the Mapping namespace

    Saturday, May 31, 2008 7:42 PM
  • Okay... So what did I miss there ?

    http://i282.photobucket.com/albums/kk276/pierreact/linq.jpg

    Thanks Smile

    Saturday, May 31, 2008 8:02 PM
  • haha! odd isn't it? Smile

     

    have you tried this on a new project and seeing what happens? What about if you rebuild your project without errors then re-adding the reference?

     

    http://www.sandlerltd.co.uk/images/linq.jpg

     

    Saturday, May 31, 2008 8:09 PM
  • It's difficult to say it but... I'm an idiot.

    Actually, the solution has two projects... Yes, the reference was added.. but on the wrong project...

    Thank you for the help Smile

     

    Saturday, May 31, 2008 8:54 PM
  • haha! odd isn't it? Smile

     

    have you tried this on a new project and seeing what happens? What about if you rebuild your project without errors then re-adding the reference?

     

    http://www.sandlerltd.co.uk/images/linq.jpg

     


    I'm sorry, I wish I had the answer to this question.  I am having the same problem.  System.Data.Linq.Mapping is not in the references drop down.  I am curious if this problem is resolved.  If someone out there has an answer I would be most appreciative.  Thanks!
    Thursday, July 09, 2009 12:01 PM
  • BigTime, it works for me (in C# express 2008) if I do the following two things:

    1)  Add System.Data.Linq to the references in the Solution Explorer, as Pierreact did.
    2)  Put "using System.Data.Linq.Mapping;" into the using list in my .cs file.

    It seems that System.Data.Linq in the references allows using its sub-namespaces in the using clause.
    • Edited by Rabiator Friday, July 31, 2009 10:29 AM typo
    Friday, July 31, 2009 10:28 AM