Hello:
I've saved a doc file and retrieved it from SQL Server. But now i need to do the same thing using oracle. But I generates error.
Error: ORA-01465: invalid hex number
Here is the code ----
protected void btnSave_Click(object sender, EventArgs e)
{
string appPath = this.MapPath(".");
string mDocPath = System.IO.Path.Combine(appPath, "Documents");
string mFilePath = System.IO.Path.Combine(mDocPath, "Juices.doc");
byte[] doc = GetDocument(mFilePath);
OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings["AsposeDBORA"].ToString());
OracleCommand cmdDoc = new OracleCommand("INSERT INTO razin.STOREDOC (Name, Document) " + "Values ( 'Juices', '" + doc + "')",con);
con.Open();
cmdDoc.ExecuteNonQuery();
con.Close();
}
public static byte[] GetDocument(string filePath)
{
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] document = br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
return document;
}
I've used Datatype Blob for document.
Can anyone tell me what's the problem.....?
Thanx-
Razin