sql - "Type 'System.Data.SqlClient.SqlConnection' is not defined." in .Net Web Site -
I am trying to get a .NET web site running on a network server, and when everything is set up Is going on locally and on my machine (using the ISEXpress), when I am deployed on a Windows Server 2008 server with IIS, I am receiving a compilation error when a SQL connection Try to use:
Pailr error message: BC30002: Character is not defined 'System.Data.SqlClient.SqlConnection'.
Now, I have an import statement at the beginning of the source file as follows:
Import system. Data.SqlClient
Import System.Data
This is a very strange error list in compilation warnings:
Warning: BC40056: There is no public member or can not be found in the specified type 'System.Data.SqlClient' in namespace or import. Ensure that the namespace or type is defined and contains at least one public member, make sure that the name of the imported element does not use any aliases.
Obviously, the compiler can not find System.Data.SqlClient. IIS is running application pool .NET 2.0, and my site is targeting 3.5. I NET is very new to development, and I am learning this, but it has stuck me. Am I losing a dependency? Do I Need SQL Server Management Studio on the Server?
some things
-
be inside your web application Right-click on System.Data
- Solution Explorer
- Click Add Reference
- Find NET and System.Data.dll
-
You already have a class called SqlConnection (your own), and the opacity in it SqlAclient / Esclonction Class can be directly system. In the context of SQL Scl Client SQL connection
Comments
Post a Comment