![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
| Messages 1 to 6 of 6 total |
| Fri, Jun 26 2009 9:21 PM | Permanent Link |
Pete Hollyer | Tim
My ODBC code works perfectly: OdbcConnection dbConn = getOdbcConnection(); OdbcDataReader DataReader; OdbcCommand dbCommand = new OdbcCommand(); SQL = " Select * "; SQL += " FROM Task"; SQL += " WHERE TaskKey = ? "; System.Windows.Forms.Application.DoEvents(); try { dbConn.Open(); dbCommand = new OdbcCommand(SQL, dbConn); dbCommand.Parameters.Add("@DBTaskKey", OdbcType.Int).Value = lngTaskKey; DataReader = dbCommand.ExecuteReader(); while (DataReader.Read()) { System.Windows.Forms.Application.DoEvents(); this.TaskKey = DataReader.GetInt64(DataReader.GetOrdinal("TaskKey")); this.ListKey = DataReader.GetInt64(DataReader.GetOrdinal("ListKey")); if (DataReader.IsDBNull(DataReader.GetOrdinal("IMAGE_01"))) this.IMAGE_01 = null; else { Byte[] FileData = new byte[DataReader.GetBytes(DataReader.GetOrdinal("IMAGE_01"), 0, null, 0, int.MaxValue)]; DataReader.GetBytes(DataReader.GetOrdinal("IMAGE_01"), 0, FileData, 0, FileData.Length); m_IMAGE_01 = FileData; } I'm trying to conver this to ElevateDB 1.09B4 dbConn.Open(); dbCommand = new EDBCommand(SQL, dbConn); DataReader = (EDBDataReader)dbCommand.ExecuteReader(); while (DataReader.Read()) { TreeNode CategoryNode = new TreeNode(); CategoryNode.Tag = "LIST-" + DataReader.GetInt64(DataReader.GetOrdinal("ListKey")); CategoryNode.Text = DataReader.GetString(DataReader.GetOrdinal("ListName")); //Load List Image Byte[] FileData = new byte[DataReader.GetBytes(DataReader.GetOrdinal("ListImage"), 0, null, 0, int.MaxValue)]; m_ListImage = FileData; } and the Byte Array is correct length but is all "0" thus an invalid Image when I convert the byte array to an image! |
| Fri, Jun 26 2009 9:58 PM | Permanent Link |
Pete Hollyer | Sorry I skipped a line in the second c# block it should be:
dbConn.Open(); dbCommand = new EDBCommand(SQL, dbConn); DataReader = (EDBDataReader)dbCommand.ExecuteReader(); while (DataReader.Read()) { TreeNode CategoryNode = new TreeNode(); CategoryNode.Tag = "LIST-" + DataReader.GetInt64(DataReader.GetOrdinal("ListKey")); CategoryNode.Text = DataReader.GetString(DataReader.GetOrdinal("ListName")); //Load List Image Byte[] FileData = new byte[DataReader.GetBytes(DataReader.GetOrdinal("ListImage"), 0, null, 0, int.MaxValue)]; DataReader.GetBytes(DataReader.GetOrdinal("ListImage"), 0, FileData, 0, FileData.Length); m_ListImage = FileData; } FileData is the correct length...but all "0"s Pete |
| Fri, Jun 26 2009 10:24 PM | Permanent Link |
Pete Hollyer | I downloaded 2.2B14 and it has the same issue....
|
| Mon, Jun 29 2009 11:58 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. | Pete,
<< I downloaded 2.2B14 and it has the same issue.... >> I'll check it out and let you know what I find out. -- Tim Young Elevate Software www.elevatesoft.com |
| Mon, Jun 29 2009 2:47 PM | Permanent Link |
Pete Hollyer | Thanks!
I believe its still a problem...but I have discovered a work around. Somewhere on here I came across you telling someone about a GetValue method that returns an Object or Object[] for blob files....I've managed to get that one working... if (DataReader.IsDBNull(DataReader.GetOrdinal("IMAGE_01"))) this.IMAGE_01 = null; else { object ObjectData = DataReader.GetValue(DataReader.GetOrdinal("IMAGE_01")); byte[] FileData = (byte[])ObjectData; m_IMAGE_01 = FileData; } |
| Tue, Jun 30 2009 2:15 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. | Pete,
<< I believe its still a problem...but I have discovered a work around. Somewhere on here I came across you telling someone about a GetValue method that returns an Object or Object[] for blob files....I've managed to get that one working... >> Nice job - that was going to be my suggestion because it is indeed an issue with the other method. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, November 17, 2026 at 03:52 AM | Privacy Policy © 2026 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

