I am trying to update some code. I have a vb file that starts with this ...
Imports System.Data.SqlClient
Imports System.Data.Sql
Imports System.Data.SqlTypes
Imports System.Configuration
<script runat="server">
... and he does not work here ...
Using oConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("tps_write").ConnectionString())
Return Error ...
"Description: An error occurred while compiling the resource needed to service this request. Review the following specific error information and modify the source code accordingly.
Compiler Error Message: BC30002: Type "SqlConnection" not defined. "
Am I missing some kind of system class?
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 he accepts it. Why do I need to explicitly write out System.Data.SqlClient every time I use an object from this class ???
source
share