listbox problem

Discussion in 'ASP .Net' started by =?Utf-8?B?QmFsYQ==?=, Dec 29, 2004.

  1. Hi,

    i am getting this error when check the list item. below is the error message
    and code i am using.

    this line i am getting error..

    If Trim(cmbGroupNo.Items.Item(j))....

    error:
    BC30311: Value of type 'System.Web.UI.WebControls.ListItem' cannot be
    converted to 'String'.

    code:

    For j = 0 To cmbGroupNo.Items.Count - 1
    If Trim(cmbGroupNo.Items.Item(j)) = Trim(Mid(GroupN(i), 1, InStr(1,
    GroupN(i), " "))) Then
    blndup = True
    Exit For
    End If
    next
    =?Utf-8?B?QmFsYQ==?=, Dec 29, 2004
    #1
    1. Advertising

  2. Hi

    It Should be cmbGroupNo.Items(j)

    It will work.


    "Bala" wrote:

    > Hi,
    >
    > i am getting this error when check the list item. below is the error message
    > and code i am using.
    >
    > this line i am getting error..
    >
    > If Trim(cmbGroupNo.Items.Item(j))....
    >
    > error:
    > BC30311: Value of type 'System.Web.UI.WebControls.ListItem' cannot be
    > converted to 'String'.
    >
    > code:
    >
    > For j = 0 To cmbGroupNo.Items.Count - 1
    > If Trim(cmbGroupNo.Items.Item(j)) = Trim(Mid(GroupN(i), 1, InStr(1,
    > GroupN(i), " "))) Then
    > blndup = True
    > Exit For
    > End If
    > next
    >
    =?Utf-8?B?Um9iaW4gQ2hhdHRlcmplZQ==?=, Dec 29, 2004
    #2
    1. Advertising

  3. Hi

    Thanks for the reply.i tried this way..it also working fine.

    cmbGroupNo.Items.Item(j).text

    thanks
    bala

    "Robin Chatterjee" wrote:

    > Hi
    >
    > It Should be cmbGroupNo.Items(j)
    >
    > It will work.
    >
    >
    > "Bala" wrote:
    >
    > > Hi,
    > >
    > > i am getting this error when check the list item. below is the error message
    > > and code i am using.
    > >
    > > this line i am getting error..
    > >
    > > If Trim(cmbGroupNo.Items.Item(j))....
    > >
    > > error:
    > > BC30311: Value of type 'System.Web.UI.WebControls.ListItem' cannot be
    > > converted to 'String'.
    > >
    > > code:
    > >
    > > For j = 0 To cmbGroupNo.Items.Count - 1
    > > If Trim(cmbGroupNo.Items.Item(j)) = Trim(Mid(GroupN(i), 1, InStr(1,
    > > GroupN(i), " "))) Then
    > > blndup = True
    > > Exit For
    > > End If
    > > next
    > >
    =?Utf-8?B?QmFsYQ==?=, Dec 29, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blenderdude
    Replies:
    0
    Views:
    801
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    393
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    866
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,313
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,635
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page