string split ??

G

Guest

I need to pass a string to a query such as server\filelocation, but its
breaking on the '\', how can I execute my query BUT have the '\' in the
string being passed to the SQL? I need the full string to return me the file
information.
 
K

Karl Seguin [MVP]

Well \ is an escape character and needs to be escaped itself. If you are
building a string, whereever you have \ you should really put \\ not sure
if that's what you are running into..

Karl
 
G

Guest

You can either escaped '\' with \\ or
use @ symbol where you are creating query
e.g.

string query = @"server\filelocation";
etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top