Introduction:
Here I will explain how to solve the problem of “unrecognized escape sequence in file path'.'” while accessing file path in C#, vb.net. Actually to solve this problem we need to use double blackslashes for filepath or @ symbol before we start declaring file path.
Description:
In previous posts I explained save files in folder and download in asp.net, read or write text file in asp.net, upload and download files from database in asp.net, download multiple files as zip folder in asp.net and many articles relating to solve errors in asp.net, SQL Server, IIS, etc. Now I will explain how to solve the problem of “unrecognized escape sequence in file path'.'” while accessing file path in C#, vb.net.
I
hope it helps you to solve your problem. Happy Coding……
Here I will explain how to solve the problem of “unrecognized escape sequence in file path'.'” while accessing file path in C#, vb.net. Actually to solve this problem we need to use double blackslashes for filepath or @ symbol before we start declaring file path.
Description:
In previous posts I explained save files in folder and download in asp.net, read or write text file in asp.net, upload and download files from database in asp.net, download multiple files as zip folder in asp.net and many articles relating to solve errors in asp.net, SQL Server, IIS, etc. Now I will explain how to solve the problem of “unrecognized escape sequence in file path'.'” while accessing file path in C#, vb.net.
In
one application I tried to access file from folder because of file path format
problem I got error like as shown below
Actually
this occurred because of file path which I mentioned in code like as shown
below
C# Code
string filepath = "E:\accessdb\Sampledb.accdb";
|
VB.NET Code
Dim filepath As String = " E:\accessdb\Sampledb.accdb"
|
To
fix this problem we need to use double blackslashes for filepath or @ symbol before we start declaring file
path like as shown below
C# Code
string filepath = "E:\\accessdb\\Sampledb.accdb";
or
string filepath = @"E:\accessdb\Sampledb.accdb";
|
VB.NET Code
Dim strquery As String = " E:\accessdb\Sampledb.accdb"
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.