none
two datacontext objects in 2010 RRS feed

  • Question

  • Since I am working with C#.net  2010, I have the following question:
     
    In a linq to sql connection that I setup with a datacontext object I did not include the organization table in the .dbml file since I received error messages that the objects in the table were already declared in the same namesapce. I can not remove the organization table from the other datacontext object since that other datacontext object is already used in production. (I want to use the general namespace instead of creating my own to keep the coding easier.)
     
    Basically what can I do to include some of the columns of the organzation table to be joined with the tables in the my new .dbml file.

    All I can think of doing is using ado.net tableadapters and datasets. I would prefer to use the datacontext object that that is newer technology.

    What do you suggest?

    Saturday, November 5, 2011 10:51 PM

Answers

  • Hi Wendy;

    In the new DBML file designer drag the organization table from Server Explorer to it and then click on the table name and change it to something else something like organization2. this will give the table a different name but still mapped to the organization table in the database. That should solve the issue.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Sunday, November 6, 2011 4:05 AM

All replies

  • Hi Wendy;

    In the new DBML file designer drag the organization table from Server Explorer to it and then click on the table name and change it to something else something like organization2. this will give the table a different name but still mapped to the organization table in the database. That should solve the issue.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Sunday, November 6, 2011 4:05 AM
  • I will try your suggestion on Monday and see if it work!
    Sunday, November 6, 2011 5:18 PM
  • This worked extremely well! Thanks!
    Monday, November 7, 2011 3:37 PM
  •  

    Not a problem, glad I was able to help.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Monday, November 7, 2011 3:41 PM