[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need to send a list of workstations to a SQL SP / its variable, but need to remove /r/n

Posted on 2009-04-05
3
Medium Priority
?
179 Views
Last Modified: 2013-12-17
I'm testing a list of workstations that will be sent as comma delimited to a SQL 2005 SP whereby the @Workstation variable will receive this list.
I went to copy and past some workstations from an Excel sheet and when I went to add this list to the Properties/Debug/Command line arguments box, and went to store them in an array,
I noticed that the workstations in the arrary were being list like this:
B001617259BA7,\r\nB001E371E21B2,\r\nB001422C95811,\r\nB001C25100C31,\r\nB001422D9BE9B,\r\nB00217091E3A0,etc. What methods are there to remove the Newline \r\n Escape sequence characters before adding them into VS 2008 for Debug testing or when sent to the SP?
Thanks for your help Experts,
Wally
[0] = "B001617259BA7,\r\nB001E371E21B2,\r\nB001422C95811,\r\nB001C25100C31,\r\nB001422D9BE9B,\r\nB00217091E3A0,\r\nB0015605A5819,\r\nB00163666A181,\r\nB0021709A9EF8,\r\nB001C23525C6B,\r\nB00188BD375BF,\r\nB0016179FBF81,\r\nB001C25143F9D,\r\nB0014C2CA6C1F,\r\nB001...

Open in new window

0
Comment
Question by:wally_davis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 24074160
Hi wally_davis;

This will do what you need.

Fernando
string Workstation = "B001617259BA7,\r\nB001E371E21B2,\r\nB001422C95811,\r\nB001C25100C31,\r\nB001422D9BE9B,\r\nB00217091E3A0,\r\nB0015605A5819,\r\nB00163666A181,\r\nB0021709A9EF8,\r\nB001C23525C6B,\r\nB00188BD375BF,\r\nB0016179FBF81,\r\nB001C25143F9D,\r\nB0014C2CA6C1F,\r\nB001";
Workstation = Workstation.Replace("\r\n", String.Empty);

Open in new window

0
 

Author Closing Comment

by:wally_davis
ID: 31566861
That was perfect Fernando. I guess I need to review all the string methods. :)
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 24083742
Glad I was able to help.  ;=)
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question