error in connection string

  • I am facing a problem in declaring connection string in datasource I write".\sqlserver"

    but in debugging error come

    "unrecognized escape sequence"

    I am using sqlserver 2005 and C # .net 2008

  • c# uses double slashes to escape and mean a regular slash; it is interpreting \s to be a special char that doesn't exist; is new line, \t is tab, you can look it up all the escapes with google.

    a drive path might be c:\\program Files\\Adobe Acrobat\\blah.exe to use in C#.

    so your server name needs to be escaped the same way... machinename\\instancename, like Lowell\\SQLExpress.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thank u for the help it works

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply