Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Setup / February 2004

Tip: Looking for answers? Try searching our database.

Bug in VS .NET 2003 CustomActionData quoting behavior?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dcaldwell - 26 Feb 2004 00:16 GMT
Hi

In the CustomActionData property in the properties window of custom action in a merge module's custom actions editor, enter a string like /bcpSwitches="-t \"<row*end>\n\""

The string retrieved via Context.Parameters["bcpSwitches"] is "-t \"<row*end>\\n\""

Note that the backslash double quote entered in the properties window is correctly quoted and yields an embedded double quote in the custom action.  However the backslash 'n' entered in the properties window is not.  In that case, the backslash itself is quoted rather than the 'n'.  Further testing shows that a backslash can also quote itself - "\\" yields "\\"

So if I want a user of my merge module to be able to enter newlines or tabs in CustomActionData values, I would have to parse the parameter value and replace "\\n" or "\\t" with "\n" or "\t".  But what if a user really wants to enter "\\n" or "\\t"?  My translation hack will erroneously yield "\n" or "\t"

IOW, the current behavior loses information.  "\n\\n" is translated by the properties window GUI into "\\n\\n", thereby stumping any attempt in the custom action to distinguish between the 2 cases

It seems like the properties window GUI should really work something like one of the 2 following ways

1) The GUI figures out which language the custom action is implemented in, then uses that language's quoting rules, o

2) The GUI uses language-independent quoting rules, which are then translated into a string properly quoted in the custom action's language

Davi
David Guyer [MS] - 26 Feb 2004 21:16 GMT
I couldn't get this to repro in VS2003 for either VB or C#.

However, if you look at the help for CustomActionData, there is some
guidance regarding directories, since they use \'s as well...  You might
also try switching to using forward slashes or -'s...

---
David Guyer - VBQA Deployment Testing
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

>Hi,

In the CustomActionData property in the properties window of custom action
in a merge module's custom actions editor, enter a string like
/bcpSwitches="-t \"<row*end>\n\"".

The string retrieved via Context.Parameters["bcpSwitches"] is "-t
\"<row*end>\\n\"".

Note that the backslash double quote entered in the properties window is
correctly quoted and yields an embedded double quote in the custom action.  
However the backslash 'n' entered in the properties window is not.  In that
case, the backslash itself is quoted rather than the 'n'.  Further testing
shows that a backslash can also quote itself - "\\" yields "\\".

So if I want a user of my merge module to be able to enter newlines or tabs
in CustomActionData values, I would have to parse the parameter value and
replace "\\n" or "\\t" with "\n" or "\t".  But what if a user really wants
to enter "\\n" or "\\t"?  My translation hack will erroneously yield "\n"
or "\t".

IOW, the current behavior loses information.  "\n\\n" is translated by the
properties window GUI into "\\n\\n", thereby stumping any attempt in the
custom action to distinguish between the 2 cases.

It seems like the properties window GUI should really work something like
one of the 2 following ways:

1) The GUI figures out which language the custom action is implemented in,
then uses that language's quoting rules, or

2) The GUI uses language-independent quoting rules, which are then
translated into a string properly quoted in the custom action's language.

David

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.