1 Replies - 293 Views - Last Post: 20 June 2012 - 02:48 AM Rate Topic: -----

#1 chinna7485  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 20-June 12

GETTING ERROR "Public member 'selected' on type 'Strin

Posted 20 June 2012 - 02:40 AM

I am trying to insert into the database of multiple selections selected through a listbox for window form.but i'm unable to do this....


Dim i As Integer
        For i = 0 To ListBox1.Items.Count - 1
            If Me.ListBox1.Items(i).selected Then
                cmd.Parameters.AddWithValue("@coursename", ListBox1.Items(i).ToString())

            End If
        Next







I'M GETTING THE ERROR "Public member 'selected' on type 'String' not found."

This post has been edited by Atli: 20 June 2012 - 02:43 AM
Reason for edit:: Fixed the [code] tags.


Is This A Good Question/Topic? 0
  • +

Replies To: GETTING ERROR "Public member 'selected' on type 'Strin

#2 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3044
  • View blog
  • Posts: 4,559
  • Joined: 08-June 10

Re: GETTING ERROR "Public member 'selected' on type 'Strin

Posted 20 June 2012 - 02:48 AM

I would have assumed that a property on a .NET control would start with an upper case letter. That is: Selected, rather than selected.

You may also want to check out the SelectedItems property. Should fit this situation perfectly.

This post has been edited by Atli: 20 June 2012 - 02:48 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1