473,395 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# String Adding Extra "\"

Hello, I am coding an web service factory application.

In service implementation code I am trying to pass a domain and user to a stored procedure on a SQL Server 2005 Database.

The problem is I cannot get c# to NOT add the extra "\"

cmd.CommandText = @"exec dbo.spWorldClockGetTimezones DS\john.doe";

I tried even hardcoding to get the process to work - in the above example I am still seeing "...DS\\xxxx.xxx" when I click on the variable during code execution.

I am able to take code and manually run it on the SQL Server.

I also tried using SQLParameter and adding a parameter - but did not seem to work - I thought the "@" was supposed to force a literal view of the string.

Any ideas would be appreciated!
Dec 14 '07 #1
3 1754
kenobewan
4,871 Expert 4TB
So cmd.CommandText = "exec dbo.spWorldClockGetTimezones DS\\john.doe"; doesn't work?
Dec 15 '07 #2
So cmd.CommandText = "exec dbo.spWorldClockGetTimezones DS\\john.doe"; doesn't work?
In that case it keeps the double "\\" instead of signaling to keep a single quote - I did try @"--------\--------------" but that still kept "\\" in the value stored in the variable.
Dec 17 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
If you are checking the value of the variable while debugging it, then that is how it will be stored. (it needs to know the escape characters). Try printing it out on the console, or onto a message box.

If it still persists, do get back
Dec 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Iker Arizmendi | last post by:
Hello all. Is there a convenient scheme within a C extension to add methods to a type in such a way as to allow me to transparently add a "proxy" around them? For example: typedef PyObject*...
10
by: Mark Sargent | last post by:
Hi All, why am I getting this error..? Cheers. Mark Sargent. Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: ''
32
by: Indrid Colt | last post by:
Thank's for your help ! Indrid
7
by: Giles | last post by:
An ASP page outputs data from the query "Select ThisAndThat from comments WHERE pageURL='" & pageURL & "' ORDER BY threadID, datesent" (Access mdb) threadID is a string (OK, I know!), which means...
9
by: Fei Liu | last post by:
In Accellerated C++, the author recommends that in a header file one should not declare using std::string, using std::vector etc instead one should directly specify the namespace specifier in...
13
by: bwaichu | last post by:
Now, I read the faq, and it suggests using sprintf. However, I want to all ways know where the integer finishes in the string. Basically, I want to: nbr | other data But the other data all...
10
by: =?Utf-8?B?RWxlbmE=?= | last post by:
I am surprised to discover that c# automatically converts an integer to a string when concatenating with the "+" operator. I thought c# was supposed to be very strict about types. Doesn't it seem...
1
by: mato81 | last post by:
Hi all! I am a newbie to WSDL. I have a questions which has been driving me crazy... If I would have a WSDL with a types element somewhat like below, what is the point of the third last row...
21
by: Sami | last post by:
string = "" or string = string.Empty? should is the proper way? Sami
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.