none
Adding DataGridView to Form in VS2012 Generates Namespace and project-level Imports errors RRS feed

  • Question

  • I added a new data source, requested the connection string be placed in the app data. The connection string tested fine. I added a dataset, edited the dataset with the designer and developed a querry that runs perfectly, etc., just as you would in VS2010. I imported the usual data suspects to the form, then I dropped the datagrid viewer onto a form. I get an error stating:

    The VS2010 methods seems to be identical VS2012.

    "Namespace or or type specified in the project-level Imports "EAuto.GetWorkDataSetTableAdapters' doesen't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element doesn't use any aliases. 

    What Imports should I be using to hook to a sql 2008R2 server?

    I deleted the form and the datasource in order to start over. After I did a rebuild, the warning still remains. How do I clean that up? The warning does not reference a file, line, column.

    Friday, January 25, 2013 5:06 PM

Answers

  • Mike,

    I found two instances of the Table adapter in the reference section of the project designer! When I unchecked the first in the list, the warning went away. I remember deleting the dataset rather than editing because I left a field out. Maybe that created two instances, but I would have expected a conflict error instead of an orphaned dataset adapter. Never would have found it without your help, nor would I have suspected the dual reference. Thank you sincerely.

    • Marked as answer by fmpeck Wednesday, January 30, 2013 11:01 PM
    • Unmarked as answer by fmpeck Wednesday, January 30, 2013 11:02 PM
    • Marked as answer by Mike FengModerator Tuesday, February 5, 2013 11:08 AM
    Wednesday, January 30, 2013 11:01 PM

All replies

  • Hi Fmpeck,

    Welcome to the MSDN Forum.

    Please check this FAQ: http://msdn.microsoft.com/en-us/library/ms234657(v=vs.110).aspx 

    To correct this error

    1. Open the Project Designer and switch to the Reference page.

    2. In the Imported namespaces section, verify that the containing element is accessible from your project.

    3. Verify that the containing element exposes at least one Public member.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 28, 2013 6:58 AM
    Moderator
  • Mike,

    I read that same article. Here is what I have in the name space, all of which is available in the Reference. Could you amplify exposing at least one public member?

    Imports System
    Imports System.Data.DataViewManager
    Imports System.Data
    Imports Microsoft
    Imports EAuto
    Imports System.Math
    Imports System.Windows.Forms
    Imports Microsoft.VisualBasic
    Imports Microsoft.SqlServer
    Imports Microsoft.SqlServer.Server

    Monday, January 28, 2013 2:32 PM
  • Hi Fmpeck,

    >>Could you amplify exposing at least one public member?

    Please check the EAuto namespace, does it contain any Public members? Such as Class, emun, struct.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 29, 2013 3:37 AM
    Moderator
  • Mike,

    I found two instances of the Table adapter in the reference section of the project designer! When I unchecked the first in the list, the warning went away. I remember deleting the dataset rather than editing because I left a field out. Maybe that created two instances, but I would have expected a conflict error instead of an orphaned dataset adapter. Never would have found it without your help, nor would I have suspected the dual reference. Thank you sincerely.

    • Marked as answer by fmpeck Wednesday, January 30, 2013 11:01 PM
    • Unmarked as answer by fmpeck Wednesday, January 30, 2013 11:02 PM
    • Marked as answer by Mike FengModerator Tuesday, February 5, 2013 11:08 AM
    Wednesday, January 30, 2013 11:01 PM