Results 1 to 6 of 6

Thread: An error occurred creating the form. See Exception.InnerException for details.

  1. #1

    Thread Starter
    Member
    Join Date
    May 2011
    Posts
    33

    An error occurred creating the form. See Exception.InnerException for details.

    Dim tags = Form2.RichTextBox1.Lines
    Dim url = ???"
    Dim urltags = ?? + tags

    Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(urltags)
    Dim response As System.Net.HttpWebResponse = request.GetResponse()
    Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
    End If
    ___________________________________________________________________________________________

    when i change

    Dim tags = Form2.RichTextBox1.Lines to form2.richtextbox1.text it works but it only scans the 1st word of the list and stops

    ___________________________________________________________________________________________
    ERROR: Operator '&' is not defined for string "https://live.xbox.com/en-GB/Prof" and type 'String()
    Last edited by League; Aug 21st, 2013 at 12:25 AM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: An error occurred creating the form. See Exception.InnerException for details.

    Code:
    Dim tags as string = string.join("put the separator here", Form2.RichTextBox1.Lines)

  3. #3

    Thread Starter
    Member
    Join Date
    May 2011
    Posts
    33

    Re: An error occurred creating the form. See Exception.InnerException for details.

    Quote Originally Posted by .paul. View Post
    Code:
    Dim tags as string = string.join("put the separator here", Form2.RichTextBox1.Lines)
    didnt work:
    Dim tags As String = String.Join("https://live.xbox.com/en-GB/Profile?gamertag=", Form2.RichTextBox1.Lines)
    doesnt work with form2.richtextbox1.text either

    error:
    Invalid URI: The format of the URI could not be determined.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: An error occurred creating the form. See Exception.InnerException for details.

    Quote Originally Posted by League View Post
    didnt work:
    Dim tags As String = String.Join("https://live.xbox.com/en-GB/Profile?gamertag=", Form2.RichTextBox1.Lines)
    doesnt work with form2.richtextbox1.text either

    error:
    Invalid URI: The format of the URI could not be determined.
    It didn't work because you didn't do it properly. .paul. specifically said:
    put the separator here
    Is "https://live.xbox.com/en-GB/Profile?gamertag=" the value you want separating the parameters? Of course it isn't. Did you actually read the documentation for String.Join to see how it works? Of course you didn't. Did you even look to see what 'tags' contains after that code?

    String.Join works by combining the list of values (the second argument) into a single String with each pair separated by the delimiter (the first argument). For instance, if you do this:
    Code:
    Dim values = {"First", "Second", "Third"}
    Dim result = String.Join("||", values)
    
    MessageBox.Show(result)
    then you will see this:
    First||Second||Third
    So, in your case, you need to specify the bit of text that you want to separate each pair of lines from the RichTextBox in the final result when you call String.Join, then you need to concatenate that result with your original URL.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member
    Join Date
    May 2011
    Posts
    33

    Re: An error occurred creating the form. See Exception.InnerException for details.

    Quote Originally Posted by jmcilhinney View Post
    It didn't work because you didn't do it properly. .paul. specifically said:Is "https://live.xbox.com/en-GB/Profile?gamertag=" the value you want separating the parameters? Of course it isn't. Did you actually read the documentation for String.Join to see how it works? Of course you didn't. Did you even look to see what 'tags' contains after that code?

    String.Join works by combining the list of values (the second argument) into a single String with each pair separated by the delimiter (the first argument). For instance, if you do this:
    Code:
    Dim values = {"First", "Second", "Third"}
    Dim result = String.Join("||", values)
    
    MessageBox.Show(result)
    then you will see this:So, in your case, you need to specify the bit of text that you want to separate each pair of lines from the RichTextBox in the final result when you call String.Join, then you need to concatenate that result with your original URL.
    didnt know what a seperator was obviously i even googled what came up was http://www.vbforums.com/showthread.p...uding-designer before posting and i googled the definition seperators also to make sure never heard of seperators in vb before now

    yes i read the code lost at seperators cause ive never heard of it so i guessed and put the link

    but thanks i actually get how it works

    made my day too youre funny <3

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: An error occurred creating the form. See Exception.InnerException for details.

    That's exactly why you should have read the documentation for the String.Join method. Surely it should be obvious that if you try to use a method and it doesn;t work, you read the instructions for that method. That documentation gives a perfectly simple example:
    Quote Originally Posted by MSDN
    For example, if separator is ", " and the elements of value are "apple", "orange", "grape", and "pear", Join(separator, value) returns "apple, orange, grape, pear".
    The Help menu in your IDE is there for a reason, as is the F1 key, which is used for Help in many thousands of Windows applications. They should ALWAYS be your first choice for help on a specific topic and using a known method is about as specific as it gets.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width