locked
Problems with imports RRS feed

  • Question

  • Hello !

    I'm creating an application in Visual basic 2013

    I have erros on these lines :

    Imports System.Data.Objects

    Imports System.Data.Objects.DataClasses

    Imports System.IO

    But I have another project that I have created on Visual basic 2012 , and if I open on vb 2013 , these lines are ok without error.

    What can I do ?

    thank you.

    Wednesday, February 19, 2014 1:36 PM

Answers

  • Add a reference to the system.data.entity dll in your references in the solution explorer

    this contains the objects and objects.dataclasses

    Wednesday, February 19, 2014 1:52 PM

All replies

  • When moving a project between different versions of VS or Net libraries I always recommend deleting the Bin folder to force all the code to recompile.  This sometimes solves issue, but not always.  If you are getting errors on the Imports statements first try to comment out these libraries and see if you get errors.  The default libraries vary slightly between version of VS.  If you still get errors in these libraries it then you need to add the libraries as reference to the project.  From the Project menu select References and on the Net Tab find the library.  In some cases you will only find the parent library so add the parent library.  You may find System.Data and not System.Data.Object nor System.Data.Objects.Dataclasses.

    jdweng

    Wednesday, February 19, 2014 1:48 PM
  • Hello,

    See the following in regards to web.config file which also mentions adding the correct reference which Joel already covered.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Wednesday, February 19, 2014 1:51 PM
  • Add a reference to the system.data.entity dll in your references in the solution explorer

    this contains the objects and objects.dataclasses

    Wednesday, February 19, 2014 1:52 PM
  • Thank you !

    Adding reference to system.data.entity resolved the problem.

    But now I have another error :

    Dim entry AsObjectStateEntry

    Dim dprov as MyEntity

     entry= dprov.ObjectStateManager.GetObjectStateEntry(entityobject.EntityKey)

    I Get an error on third line " ObjectStateManager is not a member of MyEntities "

    What can I do ?

    Thank you !

    Wednesday, February 19, 2014 2:15 PM
  • The error actually already tells you, MyEntity doesn't contain ObjectStateManager member

    Without knowing what myentity contains, not much I can do to help you. maybe you can post the Myentity class

    Wednesday, February 19, 2014 2:20 PM
  • I think you have two different modules using different versions of the library.  Try deleting the Bin folder to get all your modules to recompile.


    jdweng

    Wednesday, February 19, 2014 2:24 PM
  • I would recommend posting a new question, so that others participating in the forum can see it.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, February 19, 2014 2:27 PM
  • MyEntity is an Entity created with Sql server Database. ( Entity framework 6.02 , NET 4.0)
    Wednesday, February 19, 2014 2:31 PM
  • Hi,

    As Paul suggested, please open a new question for this issue, it will let other members can see it:)


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 20, 2014 3:06 AM