Hi,
I had a similar issue - though with NText columns in SqlCE 3.5.
See my post here : 
http://groups.google.com/group/nhusers/browse_thread/thread/47b8d0da67da9fcc?hl=en
There's some details in there of how I attempted to fix it, as well as
proposed fixes from MS forums - but nothing that helps too much.
I hope you come right.
We're implementing a work-around for this now - taken way too long
trying to get it right.
Regards,
Ross

On Sep 11, 11:48 am, Artur <[EMAIL PROTECTED]> wrote:
> On 11 Wrz, 04:31, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
>
> > I think you may want to set the length, since NH will automatically assign
> > that, IIRC.
>
> I tried setting length before, but I failed and didn't look much into
> it.
> Now I tested it more consistently and it actually helps for producing
> the schema I want (and I don't need column element with sql-type
> attribute), but not for the second problem.
>
> I've found out that BinaryBlob is mapped to VARBINARY(n) or IMAGE
> depending on specified length. If length is bigger than maximum for
> VARBINARY, than it switches to  IMAGE. It's consistent with e.g.
> MsSql2005Dialect (where it switches to VARBINARY(MAX), since IMAGE is
> deprecated), but I don't understand why it can't be IMAGE type all the
> time (with length ignored), especially when there is a separate Binary
> type in NH.
>
> I think I have found a small problem with maximum for VARBINARY for
> MsSqlCeDialect. Apparently it is set to 4000, however SQL Server CE
> docs say it is 8000.
> I created this test, based on what I found NH sources:
>
> [Test]
> public void BinaryBlob_mapping_to_SqlCe_types()
> {
>         Dialect dialect = new MsSqlCeDialect();
>         SimpleValue sv = new SimpleValue();
>         sv.TypeName = NHibernateUtil.BinaryBlob.Name;
>         Column column = new Column();
>         column.Value = sv;
>
>         // no length, should produce maximum
>         Assert.AreEqual("VARBINARY(8000)", column.GetSqlType(dialect, null));
>
>         // maximum varbinary length is 8000
>         column.Length = 8000;
>         Assert.AreEqual("VARBINARY(8000)", column.GetSqlType( dialect,
> null));
>
>         column.Length = 8001;
>         Assert.AreEqual("IMAGE", column.GetSqlType( dialect, null));
>
> }
>
> First two asserts fail.
>
> > Please create a test case for this if setting the length doesn't work.
>
> I'm not sure how that test case would need to look like. I don't know
> NH internals, so I really can't produce proper unit tests for this.
> I can create something bigger, with separate hbm.xml mapping &
> configuration file and code.
> Would it be OK?
>
> Thanks
> Artur

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to