dc

dc

  • NA
  • 663
  • 0

C# string function

Oct 29 2012 12:13 PM
In a C# 2010 application, I am placing the location  where a file is located in the directory strucutre in a sql server 2008 r2 in a varchar(500) column called file locagtion.

When the column has been updated in the sql server database, the column looks like the following:
D:\\test1\\10_29_2012\\customer1(pk12)\\

storage location comes from the following line of code:

string file_location = ConfigurationSettings.AppSettings["tLocation"] + @"\" + Format_Date + @"\" + CustomerName + "(" + pkgId + ")" + @"\";

I basically only want one backslash.

Can you tell me what I can do so the value in the database is stored with "\" instead of with "\\"?


Answers (4)