I have stored the path of the Image in the MYSQL table.Now when I try to retrieve the path, all the path is retrieved correctly except that dot(.) of .jpg is retrieved as ©jpg and thus there comes an exception that no such file exists.
string fileName =Convert.ToString(dt.Rows[rowIndex]["photo"]); //File name with Exstension and Path
FileInfo fi = new FileInfo(fileName);
BitmapImage img = new BitmapImage(); //BitmapImage for showing in the image control
img.BeginInit();
img.UriSource = new Uri(fileName);
img.EndInit();
imgPic.Source = img;
I have found the problem. I had actually changed the collation of that particular column from ascii_general_ci to armscii8_general_ci
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.