|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Wierdness with "Imports" statement----- 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 Yes. I have that in my web.config file. I also just tried adding an
"Imports System.Data" statement to the code module, but I still get the same error. Another thing I just tried: ----- Imports System.Data.SqlClient Partial Class PageHeader Inherits System.Web.UI.UserControl Public ConnectionObjG As SqlConnection = New SqlClient.SqlConnection() Public AdapterObjG As SqlDataAdapter = New SqlClient.SqlDataAdapter() .... ----- No errors. Why? Isn't it strange that the only the second reference in each case needs the "SqlClient" prefix? Thx, -Dan |
|||||||||||||||||||||||