By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

Stored Datapaths in SQL using C#

P: 1
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\\folder\\' 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
Mar 24 '08 #1
Share this Question
Share on Google+
1 Reply


deepuv04
Expert 100+
P: 227
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\\folder\\' 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.
Mar 24 '08 #2

Post your reply

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