/* THIS PART OF THE PROGRAM IS USED TO DESIGN THE FORM FOR INSERTING IMAGES INTO ORACLE 9I BLOBS*////
/// Required designer variable.
///
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
//
// txtid
//
"txtid"//
// txtname
//
"txtname"//
// lblid
//
"lblid""emp id";
//
// lblempname
//
"lblempname""emp name";
//
// btnbrowse
//
"btnbrowse""BROWSE"//
// BTNSAVE
//
"BTNSAVE""SAVE"//
// BTNCLOSE
//
"BTNCLOSE""CLOSE"//
// pctimg
//
"pctimg"//
// CRTAB
//
"CRTAB""CREATE_TABLE"//
// button1
//
"button1""SEE PHOTO"//
// Form1
//
"Form1""Form1"#endregion
/* this is the end of form design program */
/*this is the beginning of coding of image storage into oracle 9i blob */SystemSystem.Collections.GenericSystem.ComponentModelSystem.DataSystem.DrawingSystem.TextSystem.Windows.FormsSystem.Data.OracleClientSystem.IO"User Id=" + "hr"+ ";Password="+ "hr" + ";Data Source="+ "shanu;""CREATE TABLE emp22(id INTEGER,name VARCHAR2(50),photo BLOB)"//specify your own initial directory
@":D";
//this will allow onlt those file extensions to be added
fldlg.Filter="Image File (*.jpg;*.bmp;*.gif)|*.jpg;*.bmp;*.gif"" "//use filestream object to read the image.
//read to the full length of image to a byte array.
//add this byte as an oracle parameter and insert it into database.
//proceed only when the image has a valid path
""//a byte array to read the image
//open the database using odp.net and insert the data
connstr = "User Id=" + "hr" + ";Password=" + "hr" + ";Data Source=" + "shanu;""insert into emp22(id,name,photo) values(" + txtid.Text + "," + "'" + txtname.Text + "'," + " :BlobParameter )";
//insert the byte as oracle parameter of type blob
"BlobParameter""added to blob field""User Id=" + "hr" + ";Password=" + "hr" + ";Data Source=" + "shanu;""SELECT * FROM EMP22 WHERE ID=""c:image.jpg""c:image.jpg"/* THIS IS THE END OF CODING OF THE IMAGE STORAGE PROGRAM */
/*THIS IS THE BEGGING OF THE FORMS DESIGN TO STORE PDF FILES INTO ORACLE 9i BLOBS USING C#.NET *////
/// Required designer variable.
///
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
//
// button1
//
"button1""SEE PDF FILE"//
// CRTAB
//
"CRTAB""CREATE_TABLE"//
// BTNCLOSE
//
"BTNCLOSE""CLOSE"//
// BTNSAVE
//
"BTNSAVE""SAVE"//
// btnbrowse
//
"btnbrowse""BROWSE"//
// lblempname
//
"lblempname""emp name";
//
// lblid
//
"lblid""emp id";
//
// txtname
//
"txtname"//
// txtid
//
"txtid"//
// pdf_file
//
"pdf_file""pdf_file"#endregion
/* THIS IS THE END OF DESIGNING OF FORM TO STORE PDF FILES INTO ORACLE 9i BLOB FIELD */
/*THIS IS THE BEGINNING OF CODIFICATION OF THE FORM ABOVE */SystemSystem.Collections.GenericSystem.ComponentModelSystem.DataSystem.DrawingSystem.TextSystem.Windows.FormsSystem.Data.OracleClientSystem.IO//use filestream object to read the image.
//read to the full length of image to a byte array.
//add this byte as an oracle parameter and insert it into database.
//proceed only when the image has a valid path
""//a byte array to read the image
//open the database using odp.net and insert the data
connstr = "User Id=" + "hr" + ";Password=" + "hr" + ";Data Source=" + "shanu;""insert into emp32(id,name,biodata) values(" + txtid.Text + "," + "'" + txtname.Text + "'," + " :BlobParameter )";
//insert the byte as oracle parameter of type blob
"BlobParameter""added to blob field""User Id=" + "hr" + ";Password=" + "hr" + ";Data Source=" + "shanu;""CREATE TABLE emp32(id INTEGER,name VARCHAR2(50),biodata BLOB)"//specify your own initial directory
@":D";
//this will allow onlt those file extensions to be added
fldlg.Filter = "PDF File (*.pdf)|*.pdf""AcroRd32"" ""User Id=" + "hr" + ";Password=" + "hr" + ";Data Source=" + "shanu;""SELECT * FROM EMP32 WHERE ID=""c:mybio.pdf", FileMode.Create);
imagename1 = "c:mybio.pdf""AcroRd32"/* THIS IS THE END OF THE PROGRAM */