Access variable from Form2 to Form1.

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 1301 Views - Last Post: 06 October 2012 - 06:35 AM Rate Topic: -----

#16 maxbre  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 23
  • Joined: 02-October 12

Re: Access variable from Form2 to Form1.

Posted 05 October 2012 - 03:06 PM

View PostCurtis Rutland, on 05 October 2012 - 02:53 PM, said:

Tell me, do you have the "\\" in the XML file? If you do, remove one of the slashes, and it should work.


Yes, I had the "\\" in the XML file and its working now by changing to one "\". :) Thank you so much!
Was This Post Helpful? 0
  • +
  • -

#17 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4314
  • View blog
  • Posts: 7,473
  • Joined: 08-June 10

Re: Access variable from Form2 to Form1.

Posted 06 October 2012 - 06:35 AM

Ok, now I want you to understand why that is. The "\\" is an artifact of the C# language, not connection strings. Sql Server only uses one backslash between server name and instance. "\" begins an escape sequence in C#. "\n" is newline, "\t" is tab, etc...So, since "\" is a sequence, how do you just render a single backslash? By using two. "\\" renders to "\".

Of course, that's only for strings in your code. Any string from any external resource, be it the console, a text file, network communication...they don't have escape characters. They've already been rendered.

That's why you only need one backslash in your text file.
Was This Post Helpful? 2
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2