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.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.DataSet11 = New MyProject.DataSet1
CType(Me.DataSet11,
System.ComponentModel.ISupportInitialize).BeginIni t()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT USER_NAME() AS UserName"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "deleted by poster - a valid
string existed"
'
'DataSet11
'
Me.DataSet11.DataSetName = "DataSet1"
Me.DataSet11.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.DataSet11,
System.ComponentModel.ISupportInitialize).EndInit( )
End Sub
Protected WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents DataSet11 As MyProject.DataSet1
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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,System.Data.dll,System.Drawing.dll,Syste m.Web.dll WebForm1.aspx.vb
It returns the following error:
C:\Inetpub\wwwroot\MyProject\WebForm1.aspx.vb(11) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.
Me.DataSet11 = New MyProject.DataSet1
~~~~~~~~~~~~~~~~~~
C:\Inetpub\wwwroot\MyProject\WebForm1.aspx.vb(38) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.
Protected WithEvents DataSet11 As MyProject.DataSet1
~~~~~~~~~~~~~~~~~~
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.MyNameSpace.MyClass.
Perhaps this is what is causing your troubles? If not, can you show us
the code where the error is hitting?
Chris