Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 777.4k

Loading file path from Database

Jun 10 2017 2:29 AM
Hi,
 
I have a issue with loading filepath from database sql server 2008.
 
My objective is to load image file path from db and fill in pictureBox. The image will display in windows fax viewer in picture box double click event.
 
 
 
Loading and filling in pictureBox is done and  image displaying in windows fax viewer also workng in the system where I working, but While i use the application in other systems displaying image in picturBox, but not in windows fax viewer.
 

I using a string variable to store filepath from db.
 
 
The actual file path from database in the data table is :-
\\403-PC\Save Path\P2-76106967sample-indian-passport-1.jpg
 
 After storing the file path to the variable, path shows like this:-
\\\\403-PC\\Save Path\\P1-76106967czech_passport_mrz.jpg.
 
The c# code using for these given below:-
 

psprtImage = (Byte[])(dtblPsprt.Rows[0]["psprtImage"]);

Psprtmem = new MemoryStream(psprtImage);

tbPsprtPBoxPassport.Image = Image.FromStream(Psprtmem);

strPsprtFilePath = dtblPsprt.Rows[0]["filePath"].ToString();

// \\\\403-PC\Save Path\P1-76106967czech_passport_mrz.jpg

strPsprtFilepath1 = dtblPsprt.Rows[0]["filePath1"].ToString();

// \\\\403-PC\Save Path\P2-76106967sample-indian-passport-1.jpg

tbPsprtPboxPassport1.Image = null;

Byte[] image1 = new Byte[0];

image1 = (Byte[])(dtblPsprt.Rows[0]["psprtImage1"]);

PsprtMem1 = new MemoryStream(image1);

tbPsprtPboxPassport1.Image = Image.FromStream(PsprtMem1);

 

Answers (5)