D
danthman
Can someone tell me why the following VB.NET code doesn't work?
-----
Imports System.Data.SqlClient
Partial Class PageHeader
Inherits System.Web.UI.UserControl
Public ConnectionObjG As SqlConnection = New SqlConnection()
Public AdapterObjG As SqlDataAdapter = New SqlDataAdapter()
...
-----
I get the following errors:
Type 'SqlConnection' is not defined.
Type 'SqlDataAdapter' is not defined.
The wierd part is that I get the squiggly "you did something wrong"
underlines after "New" but not after "As". If you don't have Visual
Studio .NET, the squiggly underlines shows where the errors are (like
the spellchecker in MS Word).
Even more strange: If I put the following code in my web.config file, I
get no errors at all.
-----
<add namespace="System.Data.SqlClient" />
-----
Any idea what's going on here? Why is Import not importing?
Thanks,
-Dan
-----
Imports System.Data.SqlClient
Partial Class PageHeader
Inherits System.Web.UI.UserControl
Public ConnectionObjG As SqlConnection = New SqlConnection()
Public AdapterObjG As SqlDataAdapter = New SqlDataAdapter()
...
-----
I get the following errors:
Type 'SqlConnection' is not defined.
Type 'SqlDataAdapter' is not defined.
The wierd part is that I get the squiggly "you did something wrong"
underlines after "New" but not after "As". If you don't have Visual
Studio .NET, the squiggly underlines shows where the errors are (like
the spellchecker in MS Word).
Even more strange: If I put the following code in my web.config file, I
get no errors at all.
-----
<add namespace="System.Data.SqlClient" />
-----
Any idea what's going on here? Why is Import not importing?
Thanks,
-Dan