Solved

How would this look in VB

Posted on 2006-06-20
17
234 Views
Last Modified: 2010-04-16
I'm trying to translate some c# code to vb.net:

using System;
using System.Collections;

namespace com.ariaware.pizza.vo
{
  /// <summary>
  /// OrderVO class
  ///
  /// To make the class mapping place
  /// in OrderVO.as in the constructor
  /// Object.registerClass("com.ariaware.pizza.vo.OrderVO", OrderVO);
  /// </summary>
  public class OrderVO
  {
    string  _name;
    /// <summary>
    /// This will hold a list of ASObjects
    /// </summary>
    IList  _orders;

    public OrderVO()
    {
    }

    public string name
    {
      get{ return _name; }
      set{ _name = value; }
    }

    public IList orders
    {
      get{ return _orders; }
      set{ _orders = value; }
    }
  }
}

the translator i normally use at http://authors.aspalliance.com/aldotnet/examples/translate.aspx translates the above to:

Imports System
Imports System.Collections


Namespace com.ariaware.pizza.vo
    '/ <summary>
    '/ OrderVO class
    '/
    '/ To make the class mapping place
    '/ in OrderVO.as in the constructor
    '/ Object.registerClass("com.ariaware.pizza.vo.OrderVO", OrderVO);
    '/ </summary>
    Public Class OrderVO
        Private _name As String
        '/ <summary>
        '/ This will hold a list of ASObjects
        '/ </summary>
        Private _orders As IList



        Public Sub New()
        End Sub 'New


        Public Property name() As String
            Get
                Return _name
            End Get
            Set(ByVal Value As String)
                _name = value
            End Set
        End Property

        Public Property orders() As IList
            Get
                Return _orders
            End Get
            Set(ByVal Value As IList)
                _orders = value
            End Set
        End Property
    End Class 'OrderVO
End Namespace 'com.ariaware.pizza.vo

But when I save the above to a class file, the other class that attempts to import this namespace tosses a compiler error insisting that

Namespace or type 'vo' for the Imports 'com.ariaware.pizza.vo' cannot be found.
and
Type 'OrderVO' is not defined.
0
Comment
Question by:juststeve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
17 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16946094
Is the other class in the same namespace?

Bob
0
 

Author Comment

by:juststeve
ID: 16946108
nope
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16946197
What line is the compiler error on?

Bob
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:juststeve
ID: 16946437
...pizzaService.vb(10): Namespace or type 'vo' for the Imports 'com.ariaware.pizza.vo' cannot be found.
points at:
   Imports com.ariaware.pizza.vo

and
   pizzaService.vb(37): Type 'OrderVO' is not defined.
points at:
    Public Function order(ByVal orderVO As OrderVO) As Long
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16946507
Does the project have a root namespace specified?

Bob
0
 

Author Comment

by:juststeve
ID: 16946629
Where would I see that...the only non-standard entry in web.config is:

<httpModules>
  <add name="FluorineGateway" type="com.TheSilentGroup.Fluorine.FluorineGateway, com.TheSilentGroup.Fluorine" />
</httpModules>
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16946660
1) .NET version?  2002, 2003, or 2005?

2) ASP.NET I assume?

3) What are you doing with this code?

Bob
0
 

Author Comment

by:juststeve
ID: 17014699
I'm trying to setup a tutorial (distributed in C#) demonstrating Fluorine. I'm trying to replicate stuff in vb. Usually I've been able to translate C# to VB at the site referenced above without any problems.

right...asp.net 1.1 under VS.net 2003
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17017169
This is a screen shot C# project properties indicating what I mean by default Namespace (root):
https://filedb.experts-exchange.com/incoming/ee-stuff/314-C--Project-Properties---Default-.png 

Bob
0
 

Author Comment

by:juststeve
ID: 17017464
Default namespace holds: FluorinePizzaService.

The project itself is described by the author as a straight forward, simple asp.net app. It's sole purpose is to demonstrate to component's connection to a Flash app. Fluorine is an open source Flash Remoting component. Project files here:

  http://fluorine.thesilentgroup.com/fluorine/pizzaservice.zip
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17017505
What is the reference 'com.TheSilentGroup.Fluorine' to?

Bob
0
 

Author Comment

by:juststeve
ID: 17017969
That's the dll they distribute.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17030715
What is the root Namespace for the VB.NET project?  Try setting it to a blank.

Bob
0
 
LVL 70

Expert Comment

by:garycase
ID: 17259290
juststeve -> Have you seen this: http://www.anandtech.com/cpuchipsets/showdoc.aspx?i=2795  (Pay particular attention to the SYSmarks on Page 8)

Thought it might be useful regarding your question at:
http://www.experts-exchange.com/Hardware/Q_21924192.html

Sorry for the interruption to this thread => the previous question is closed for comments and juststeve doesn't have his e-mail in his profile.
0
 

Author Comment

by:juststeve
ID: 17260865
Sry...just back from vacation....blabking out the namespace _did remove the error....thx much for your patience.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question