Chris,
I'm not using the namespace statement. The name of the project namespace in
my example would by "MyProject" .
OK, I just made a simple project for the sake of example. I named the
project "MyProject" . When I look at the properties of the project, the root
namespace is named "MyProject" .
There is one webform - Webform1.aspx. I added a DataAdapter to it and
generated a dataset named DataSet1 (DataSet1.xsd).
Here is the code (all system generated), the vbc.exe command is below too:
Public Class WebForm1
Inherits System.Web.UI.P age
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub
InitializeCompo nent()
Me.SqlDataAdapt er1 = New System.Data.Sql Client.SqlDataA dapter
Me.SqlSelectCom mand1 = New System.Data.Sql Client.SqlComma nd
Me.SqlConnectio n1 = New System.Data.Sql Client.SqlConne ction
Me.DataSet11 = New MyProject.DataS et1
CType(Me.DataSe t11,
System.Componen tModel.ISupport Initialize).Beg inInit()
'
'SqlDataAdapter 1
'
Me.SqlDataAdapt er1.SelectComma nd = Me.SqlSelectCom mand1
'
'SqlSelectComma nd1
'
Me.SqlSelectCom mand1.CommandTe xt = "SELECT USER_NAME() AS UserName"
Me.SqlSelectCom mand1.Connectio n = Me.SqlConnectio n1
'
'SqlConnection1
'
Me.SqlConnectio n1.ConnectionSt ring = "deleted by poster - a valid
string existed"
'
'DataSet11
'
Me.DataSet11.Da taSetName = "DataSet1"
Me.DataSet11.Lo cale = New System.Globaliz ation.CultureIn fo("en-US")
CType(Me.DataSe t11,
System.Componen tModel.ISupport Initialize).End Init()
End Sub
Protected WithEvents SqlDataAdapter1 As
System.Data.Sql Client.SqlDataA dapter
Protected WithEvents SqlSelectComman d1 As System.Data.Sql Client.SqlComma nd
Protected WithEvents SqlConnection1 As System.Data.Sql Client.SqlConne ction
Protected WithEvents DataSet11 As MyProject.DataS et1
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
End Class
It compiles without a problem and loads the page in Visual Studio
I run the following vbc.exe command:
vbc.exe /target:library /out:bin/MyProject.dll /r:S
ystem.dll,Syste m.Data.dll,Syst em.Drawing.dll, System.Web.dll WebForm1.aspx.v b
It returns the following error:
C:\Inetpub\wwwr oot\MyProject\W ebForm1.aspx.vb (11) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.
Me.DataSet11 = New MyProject.DataS et1
~~~~~~~~~~~~~~~ ~~~
C:\Inetpub\wwwr oot\MyProject\W ebForm1.aspx.vb (38) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.
Protected WithEvents DataSet11 As MyProject.DataS et1
~~~~~~~~~~~~~~~ ~~~
Thanks,
Scott
--
Scott Thompson
"Chris Dunaway" wrote:
>
Inside VS, do you use the Namespace statement? Be aware that in
addition to the Namespace statement, the VB projects have a root
namespace that affects the names of all the namespaces you declare.
This can be found in the project properties.
Thus, if your root namespace for the project is something like:
Com.MyCompany
and in your code you use a Namespace statement:
Namespace MyNameSpace
Public Class MyClass
End Class
End Namespace
Then the fully qualified name for this class is:
Com.MyCompany.M yNameSpace.MyCl ass.
Perhaps this is what is causing your troubles? If not, can you show us
the code where the error is hitting?
Chris