Conversion from C# to VB

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

30 Replies - 1293 Views - Last Post: 04 March 2012 - 08:22 PM Rate Topic: -----

#16 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:04 PM

If its the end of the With block I dont think you need another comma…
Was This Post Helpful? 0
  • +
  • -

#17 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:06 PM

View PostDimitriV, on 03 March 2012 - 03:04 PM, said:

If its the end of the With block I dont think you need another comma…



Wow!!!You guys rock. Thanks it's fine now. Converting from C # to VB.NET sure gives a lot of errors.
Was This Post Helpful? 0
  • +
  • -

#18 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:10 PM

Glad we could help :bananaman:
Was This Post Helpful? 0
  • +
  • -

#19 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:12 PM

Does anyone know by any chance what this means :

" 'SalesRepID_'is not a member of 'UsedCarsSales.UsedCarsSales.SalesRep' "

Private Sub LoadGroupData()
			Try
				Dim reader As New CSVReader()
                Dim result = From s In reader.GetSales() _
                                         Join c In reader.GetSalesRep() _
                                         On s.SalesRepID Equals c.SalesRepID_
                Order By c.SalesRepID_


View PostDimitriV, on 03 March 2012 - 03:10 PM, said:

Glad we could help :bananaman:



Thanks you guys more than helped.
Was This Post Helpful? 0
  • +
  • -

#20 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:15 PM

It just means that there is no object named SalesRepID within the class/object/control that is UsedCarsSales.UsedCarsSales.SalesRep.
Was This Post Helpful? 0
  • +
  • -

#21 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:21 PM

View PostDimitriV, on 03 March 2012 - 03:15 PM, said:

It just means that there is no object named SalesRepID within the class/object/control that is UsedCarsSales.UsedCarsSales.SalesRep.


Hmm, okay...just don't know where to find it.
Was This Post Helpful? 0
  • +
  • -

#22 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:25 PM

I'm confused now, this sure as hell looks like a custom class. Unless I'm mistaken, vb doesn't have a class for car sales. Can we see the UsedCarsSales.UsedCarsSales.SalesRep class?
Was This Post Helpful? 0
  • +
  • -

#23 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:29 PM

View PostDimitriV, on 03 March 2012 - 03:25 PM, said:

I'm confused now, this sure as hell looks like a custom class. Unless I'm mistaken, vb doesn't have a class for car sales. Can we see the UsedCarsSales.UsedCarsSales.SalesRep class?


This should be it :

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.ComponentModel

Namespace UsedCarsSales
	Public Class SalesRep

		Public Property SalesRepID() As Integer
			Get
				Return m_SalesRepID
			End Get
			Set
				m_SalesRepID = Value
			End Set
		End Property
		Private m_SalesRepID As Integer

		Public Property LastName() As String
			Get
				Return m_LastName
			End Get
			Set
				m_LastName = Value
			End Set
		End Property
		Private m_LastName As String

		Public Property FirstName() As String
			Get
				Return m_FirstName
			End Get
			Set
				m_FirstName = Value
			End Set
		End Property
		Private m_FirstName As String

		Public Property PhotoFile() As String
			Get
				Return m_PhotoFile
			End Get
			Set
				m_PhotoFile = Value
			End Set
		End Property
		Private m_PhotoFile As String

		Public Property StartDate() As String
			Get
				Return m_StartDate
			End Get
			Set
				m_StartDate = Value
			End Set
		End Property
		Private m_StartDate As String

		Public Property Sales() As List(Of Sales)
			Get
				Return m_Sales
			End Get
			Set
				m_Sales = Value
			End Set
		End Property
		Private m_Sales As List(Of Sales)

	End Class
End Namespace




Was This Post Helpful? 0
  • +
  • -

#24 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:36 PM

Order By c.SalesRepID_

I think you were confusing the compiler into thinking that you were referring to a member named c.SalesRepID_ when you were trying to put a line break. Aren't you meant to precede them by a space?
Order By c.SalesRepID _

Was This Post Helpful? 0
  • +
  • -

#25 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: Conversion from C# to VB

Posted 03 March 2012 - 03:48 PM

Underscore char is the cause. Note: you're using vs2010 or later, it has implicit line continuations for almost the places where it could be used. The only time it's used now, is to clarify ambiguities.

This post has been edited by AdamSpeight2008: 03 March 2012 - 03:50 PM

Was This Post Helpful? 0
  • +
  • -

#26 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 09:53 PM

View PostAdamSpeight2008, on 03 March 2012 - 03:48 PM, said:

Underscore char is the cause. Note: you're using vs2010 or later, it has implicit line continuations for almost the places where it could be used. The only time it's used now, is to clarify ambiguities.



You guys rock. Thanks a bunch. It is so easy when the problem is pointed out.

I have this other Error if you guys can tell me what it means, i will appreciate it.


Error : Properties is not a member of 'UsedCarsSales'


' toolStripButtonSave
			' 
			Me.toolStripButtonSave.Image = Global.UsedCarsSales.Properties.Resources.Save
			Me.toolStripButtonSave.ImageTransparentColor = System.Drawing.Color.Magenta
			Me.toolStripButtonSave.Name = "toolStripButtonSave"
			Me.toolStripButtonSave.Size = New System.Drawing.Size(35, 35)
			Me.toolStripButtonSave.Text = "Save"
			Me.toolStripButtonSave.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            AddHandler Me.toolStripButtonSave.Click, AddressOf Me.toolStripButtonSave_Click
			' 

Was This Post Helpful? 0
  • +
  • -

#27 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 03 March 2012 - 11:33 PM

That just means that you don't have a variable/class/object/module named Properties in the namespace for UsedCarSales. This is wrong - it should be pointing to an image in resources, byte array or file.
Was This Post Helpful? 0
  • +
  • -

#28 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 03 March 2012 - 11:38 PM

View PostDimitriV, on 03 March 2012 - 11:33 PM, said:

That just means that you don't have a variable/class/object/module named Properties in the namespace for UsedCarSales. This is wrong - it should be pointing to an image in resources, byte array or file.



Hmm...so do you advice i create a "Properties class" ?
Was This Post Helpful? 0
  • +
  • -

#29 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Conversion from C# to VB

Posted 04 March 2012 - 07:59 PM

No... set it to the path of an image, either Image.FromFile or a Resources image.
Was This Post Helpful? 0
  • +
  • -

#30 flyj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-March 12

Re: Conversion from C# to VB

Posted 04 March 2012 - 08:19 PM

View PostDimitriV, on 04 March 2012 - 07:59 PM, said:

No... set it to the path of an image, either Image.FromFile or a Resources image.



Oh i set it to the path of an Image (Folder_Open)

  Me.toolStripButtonOpenFile.Image = Global.UsedCarsSales.Properties.Resources.Folder_Open


But it still gives me the 'Properties' is not a member of 'UsedCarsSales'

I wonder what am doing wrong.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3