Results 1 to 3 of 3

Thread: [RESOLVED] 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Resolved [RESOLVED] 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'

    Hi all,

    I am creating class libraries in my project so that I can update code without having to update the whole app.

    I created a class library project and added some code to it. I also added a reference to System.Data.SqlClient and also imported it into the class file.

    I am getting an error and I have never seen it before. Been looking online and not able to find an answer yet. Any ideas? Screen shot attached.

    I went here and it said:
    Represents an open connection to a SQL Server database. This class cannot be inherited.
    But I am not inheriting it.
    Attached Images Attached Images  

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'

    OK. I found the answer after going through hundreds of posts. You have to remove the reference to System.Data.SqlClient and ONLY import it.

  3. #3
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: [RESOLVED] 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'

    Right, first off, never post a screenshot with a scroll bar in it. Do you know how many times I tried to drag that scroll bar to see a bit more of your code?



    Secondly, have you declared a class or variable anywhere named SqlConnection?

    In fact, do a Find In Files across your entire solution for 'SqlConnection' and post the results.
    Last edited by Evil_Giraffe; Jan 23rd, 2011 at 09:02 PM. Reason: Correcting smiley

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width