Stored Datapaths in SQL using C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seriumX
    New Member
    • Mar 2008
    • 1

    Stored Datapaths in SQL using C#

    Hello,

    I am not sure where to post this, so I apologize if this is not in the right place.

    I work for a company that is converting it's current VB6 and .net web application to C# .net. We have our various data paths stored in a table in our database. This works fine with VB6 and VB.net, but I am having trouble with C#. Apparently '\' is a special character reserved for C# and whenever I bring back a path from the database I get '\\\\ServerName \\folder\\folde r\\' and so on. I know I can hard code paths with an '@' in front of the string, but this doesn't help with stored paths in our database. Is there a certain way I need to set up the Stored Proc or even the way the paths are stored in order to get around this?

    thanks,

    Chad
  • deepuv04
    Recognized Expert New Member
    • Nov 2007
    • 227

    #2
    Originally posted by seriumX
    Hello,

    I am not sure where to post this, so I apologize if this is not in the right place.

    I work for a company that is converting it's current VB6 and .net web application to C# .net. We have our various data paths stored in a table in our database. This works fine with VB6 and VB.net, but I am having trouble with C#. Apparently '\' is a special character reserved for C# and whenever I bring back a path from the database I get '\\\\ServerName \\folder\\folde r\\' and so on. I know I can hard code paths with an '@' in front of the string, but this doesn't help with stored paths in our database. Is there a certain way I need to set up the Stored Proc or even the way the paths are stored in order to get around this?

    thanks,

    Chad
    whenever you bring back the path from database replace'\\' with '\' in your application, or at database level and then use the path.

    Comment

    Working...