How do i solve this error?

Discussion in 'ASP .Net' started by Miguel Dias Moura, Dec 9, 2004.

  1. Hello,

    I am passing some values in the URL like this:
    ....search.aspx?keywords=asp%20book

    Then to split the words I use this:

    Sub Page_Load(sender As Object, e As System.EventArgs)
    string[] sr = Request.QueryString("keywords").Split(' ') ****
    End Sub

    I get this error on line ****:
    BC30109: 'String' is a class type, and so is not a valid expression

    What am I doing wrong?

    Thanks,
    Miguel
    Miguel Dias Moura, Dec 9, 2004
    #1
    1. Advertising

  2. "Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
    news:...
    > Hello,
    >
    > I am passing some values in the URL like this:
    > ...search.aspx?keywords=asp%20book
    >
    > Then to split the words I use this:
    >
    > Sub Page_Load(sender As Object, e As System.EventArgs)
    > string[] sr = Request.QueryString("keywords").Split(' ') ****
    > End Sub


    "string[]" is C# syntax. You want:

    Dim sr as String() = ...

    John Saunders
    John Saunders, Dec 9, 2004
    #2
    1. Advertising

  3. Miguel Dias Moura

    dd Guest

    Dim sr() As String = Request.QueryString("keywords").Split(CChar(""))

    "Miguel Dias Moura" <md*REMOVE*moura@*NOSPAM*gmail.com> wrote in message
    news:...
    > Hello,
    >
    > I am passing some values in the URL like this:
    > ...search.aspx?keywords=asp%20book
    >
    > Then to split the words I use this:
    >
    > Sub Page_Load(sender As Object, e As System.EventArgs)
    > string[] sr = Request.QueryString("keywords").Split(' ') ****
    > End Sub
    >
    > I get this error on line ****:
    > BC30109: 'String' is a class type, and so is not a valid expression
    >
    > What am I doing wrong?
    >
    > Thanks,
    > Miguel
    >
    dd, Dec 9, 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. Ajith Nair
    Replies:
    0
    Views:
    1,620
    Ajith Nair
    Aug 17, 2005
  2. Erland
    Replies:
    1
    Views:
    377
    =?Utf-8?B?RGFsZQ==?=
    Apr 13, 2006
  3. Replies:
    4
    Views:
    1,853
    Babu Kalakrishnan
    Oct 5, 2004
  4. bruce
    Replies:
    0
    Views:
    487
    bruce
    Jul 21, 2008
  5. bruce
    Replies:
    0
    Views:
    613
    bruce
    Jul 21, 2008
Loading...

Share This Page