From: David V <dav...@ho...> - 2002-12-27 05:30:49
|
How do you inset a blob into a firebird table? The code: command.CommandText = "INSERT INTO testBLOB (itemId, description) VALUES (" + aId + ", ?)"; FileInfo blobFile = new FileInfo(@"C:\Development\Temp\text.xml"); FileStream stream = blobFile.Open(FileMode.Open); int length = (int) stream.Length; Byte[] b = new Byte[length]; stream.Read(b, 0, length); stream.Close(); command.Parameters.Add("@description", FirebirdSql.Data.Firebird.FbType.Binary, "description"); command.Parameters[0].Value = b; command.Prepare(); command.ExecuteNonQuery(); Throws an "InvalidCastException: Object must implement IConvertible". Any ideas whats wrong? _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 |