Imports System.Data.sqlClient Imports System.Data.sql Imports System.Data.sqlTypes Imports System.Configuration <script runat="server">
……而且它在这里失败了……
Using oConn As sqlConnection = New sqlConnection(ConfigurationManager.ConnectionStrings("tps_write").ConnectionString())
它返回的错误是……
“Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type ‘sqlConnection’ is not defined.”
我错过了一些系统类吗?
编辑:我更新了代码…
Using oConn As System.Data.sqlClient.sqlConnection = New System.Data.sqlClient.sqlConnection(ConfigurationManager.ConnectionStrings("tps_write").ConnectionString())
解决方法
EDIT: I updated the code to this…
Using oConn As
System.Data.sqlClient.sqlConnection =
New
System.Data.sqlClient.sqlConnection(ConfigurationManager.ConnectionStrings(“tps_write”).ConnectionString())…and it accepts it. Why do I need to
explicitly write out
System.Data.sqlClient every time I use
an object from that class???
我最好的猜测是,有一个名为sqlConnection的类,在您明确指定System.Data.sqlClient.sqlConnection之前,.NET不知道要使用哪种类型.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。