strange error in VB.NET 
Author Message
 strange error in VB.NET

Hello i have a class "clsTest"  with 1 property, when i do this
Dim ob As clsTest

ob.Waarde1 = TextBox1.Text

i get a message saying

No argument specified for non-optional parameter 'sWaarde' of method 'Sub
set_Waarde1(sWaarde As String, Value As String)'.

can someone help me out

Dieter De Preester
ps:
this is the class description
Public Class clsTest

Private msWaarde As String

Public Property Waarde1(ByVal sWaarde As String) As String

Get

Waarde1 = msWaarde

End Get

Set

msWaarde = sWaarde

End Set

End Property

End Class



Wed, 23 Jul 2003 00:11:31 GMT  
 strange error in VB.NET
That should be

public property waarde1() as string
    get
        return msWaarde
    end get
    set
        msWaarde = value
    end set
end property

- Jeremy


Quote:
> Hello i have a class "clsTest"  with 1 property, when i do this
> Dim ob As clsTest

> ob.Waarde1 = TextBox1.Text

> i get a message saying

> No argument specified for non-optional parameter 'sWaarde' of method 'Sub
> set_Waarde1(sWaarde As String, Value As String)'.

> can someone help me out

> Dieter De Preester
> ps:
> this is the class description
> Public Class clsTest

> Private msWaarde As String

> Public Property Waarde1(ByVal sWaarde As String) As String

> Get

> Waarde1 = msWaarde

> End Get

> Set

> msWaarde = sWaarde

> End Set

> End Property

> End Class



Wed, 23 Jul 2003 03:15:58 GMT  
 strange error in VB.NET



<cut>
The syntax is:

Public Property Waarde1() As String
  Get
      Waarde1 = msWaarde
  End Get
  Set
      msWaarde = Value ' "Value" is implicitly defined
  End Set
End Property



Wed, 23 Jul 2003 00:22:41 GMT  
 strange error in VB.NET
can you explain where the values comes from, this is not a VB.NET keyword

Quote:
> That should be

> public property waarde1() as string
>     get
>         return msWaarde
>     end get
>     set
>         msWaarde = value
>     end set
> end property

> - Jeremy


> > Hello i have a class "clsTest"  with 1 property, when i do this
> > Dim ob As clsTest

> > ob.Waarde1 = TextBox1.Text

> > i get a message saying

> > No argument specified for non-optional parameter 'sWaarde' of method
'Sub
> > set_Waarde1(sWaarde As String, Value As String)'.

> > can someone help me out

> > Dieter De Preester
> > ps:
> > this is the class description
> > Public Class clsTest

> > Private msWaarde As String

> > Public Property Waarde1(ByVal sWaarde As String) As String

> > Get

> > Waarde1 = msWaarde

> > End Get

> > Set

> > msWaarde = sWaarde

> > End Set

> > End Property

> > End Class



Wed, 23 Jul 2003 00:21:29 GMT  
 strange error in VB.NET
now i get a error saying

Option Strict disallows implicit conversions from System.Object to
WindowsApplication2.clsTest.
this is the code. Instance of my class are in a ArrayList and i want to read
them out.

list is from the type ArrayList
Protected Sub cmdViewItems_Click(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim i As Integer

Dim ob As New clsTest()

For i = 0 To list.Count - 1

ob = list.Item(i)      'ERROR LINE Option Strict disallows implicit
conversions from System.Object to WindowsApplication2.clsTest.

ListBox1.Items.Add(ob.Waarde1)

Next

End Sub


Quote:



> <cut>
> The syntax is:

> Public Property Waarde1() As String
>   Get
>       Waarde1 = msWaarde
>   End Get
>   Set
>       msWaarde = Value ' "Value" is implicitly defined
>   End Set
> End Property



Wed, 23 Jul 2003 00:31:38 GMT  
 strange error in VB.NET

Quote:
> now i get a error saying

> Option Strict disallows implicit conversions from System.Object to
> WindowsApplication2.clsTest.
> this is the code. Instance of my class are in a ArrayList and i want to read
> them out.

> ob = list.Item(i)      'ERROR LINE Option Strict disallows implicit
> conversions from System.Object to WindowsApplication2.clsTest.

Cast it to the proper type:

ob = CType(list.Item(i), WindowsApplication2.clsTest)

--
Patrick Steele

Lead Software Architect



Wed, 23 Jul 2003 00:49:27 GMT  
 strange error in VB.NET

Quote:
> can you explain where the values comes from, this is not a VB.NET keyword

It's a predefined variable that is present within the Set. Kinda like
Inserted/Deleted in SQL Server triggers.


Wed, 23 Jul 2003 02:51:55 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. strange VB error: Unkown system error:(-1000040)

2. VB.NET Media Player COM strange problem

3. VB.NET Media Player COM strange problem

4. Very strange printing Problem in VB.NET

5. Strange result in vb.net

6. Random select a record from .mdb works strange in VB.net

7. A STRANGE BUG IN VB.NET TabControl

8. VB.net listview strange behavior on key press

9. Strange VB.NET Overrides behavior

10. Strange Strange Error

11. .NET VB.NET/ WebService access error

12. Error in temp file in running crystal report for .net in vb.net

 

 
Powered by phpBB® Forum Software