StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Images and Null ValuesExpand / Collapse
Author
Message
Posted 01/21/2008 12:28:57 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 11:48:02 AM
Posts: 473, Visits: 1,938
I do not know what happened.  All was going quite well.  The demo Friday was excellent...no errors in the presentation.  One of the users suggested that I reimport our part data so that the two systems are synchronized on Monday.  No problem.  I had the SQL script ready to fire in that event. 

Last night I ran the import.  No problems.

Today, users are sending me lots of error windows.  In my initial investigation, I ran across a problem with the image field in the part table.  It was working fine before, but now it won't handle null data.  This just doesn't make sense.  I ran the DevEx update to the most recent control suite and also reset the Inherited UI project.  No problems with that; however, that makes no difference. 

What could I have done to mess up my image handling?

Thanks!
Bill

Post #13598
Posted 01/21/2008 12:37:16 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 11:48:02 AM
Posts: 473, Visits: 1,938
The specific error that I am getting is "{"Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'."}". 

This is the property code on which the error occurs:

public System.Byte[] sketch
{
   
get
   
{
       
return (System.Byte[])this.CurrentRow["sketch"];  <---error fires on this line!
    }
   
set
   
{
       
this.CurrentRow["sketch"] = value;
    }
}

I thought I would try the old replace value on null trick, but I cannot seem to get the C# syntax right.  But, then I keep thinking that I did not have to do that before the import.  It was working fine with the code above. 

Thoughts, anyone?
Bill

Post #13599
Posted 01/21/2008 1:10:46 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 11:48:02 AM
Posts: 473, Visits: 1,938
I added the following syntax to the replacement value:

new byte[] {}

That works...but I still do not know what went wrong.

Post #13600
Posted 01/21/2008 4:54:34 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 3:20:54 PM
Posts: 4,769, Visits: 4,731
I see how the error manifested itself, but I am not sure what changed between your versions.  Your correction is the same thing that I would have done...but without further investigation I am not sure I could give you a straight answer
Post #13605
Posted 01/21/2008 5:21:53 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 11:48:02 AM
Posts: 473, Visits: 1,938
No biggie...I will take a pragmatic approach on this one.  It is working, so I'll just tip-toe as I walk by any of that code in the future.
Post #13611
Posted 01/23/2008 9:04:48 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
Seems to be that when you had the version working, there were no NULL values in the database for your testing data, but when you merged the two databases, several of the images were missing and were replaced by NULLs.  BTW, by default, a StrataFrame business object will insert an empty array for a byte[] field, so any new rows generated through the business objects would not have thrown the error.  However, when you set the AllowNullValuesOnNewRow property to true, the NULL value is not replaced, so you could then end up with NULL values in that field.


www.bungie.net
Post #13666
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:10am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.