Problem with TimeStamp parameter on Insert

Problem with TimeStamp parameter on Insert

Old forum URL: forums.lhotka.net/forums/t/1290.aspx


David posted on Wednesday, September 20, 2006

I am using the EditableRoot template to create an object that has a LastChanged timestamp column (using the partial class option). When I do an insert I get this error:

System.InvalidOperationException: String[26]: the Size property has an invalid size of 0.
at System.Data.SqlClient.SqlParameter.Validate(Int32 index)

The problem is due to the fact that mLastChanged has not been initialised when it is added to the parameter collection. There are a number of ways to fix this, but possibly the easiest is to change the declaration of the member variable for timestamp columns from this:

   Private mLastChanged As Byte()

to this:

   Private mLastChanged(7) As Byte

I would also like to add my vote to include support for write first concurrency.

rasupit replied on Thursday, September 21, 2006

The C# version has been fixed and is now available on CSLAContrib (build 6445)

Copyright (c) Marimer LLC