0

I'm debugging ASP application from usb flash (there is located project and I use MS Visual studio) I don't know how to indicate path to db file i try string db_adres = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=J:\test.mdb"; but this is wrong path

1 Answer 1

2

In C# you should prefix this kind of string with the char @

string db_adres = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='J:\test.mdb'";

or double the \ character

string db_adres = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='J:\\test.mdb'";

The first one is called 'verbatim string', the second one is an 'escaped string'
Look here at C# specifications 2.4.4.5 "String Literals"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.