Search   

Friday, February 10, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  nvarchar(max)...
 nvarchar(max)
 
 1/8/2007 1:42:49 PM
mig
9 posts


nvarchar(max)
I found in the 'Solutions' a comment that nvarchar(max) is supported since SP1 but I can't find any information how to use this feature. Can you please tell me how to do? Greetings Michael
 1/15/2007 7:07:22 PM
Mirko
109 posts
5th


Re: nvarchar(max)

Hi Michael,

open the mapping tool and enter "nvarchar(max)" (without the quotes) as ColumnType. That should do it.

Mirko

 6/25/2007 12:25:29 PM
mig
9 posts


Re: nvarchar(max)
At the first moment it seemed like if it works this way.

But now I discovered that it will not work if the data is longer than about 1000 characters.

I get the following exception:

"Exception of type SqlException while updating or inserting data rows: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 9 (\"@U_Notiz\"): Data type 0xE7 has an invalid data length or metadata length.\nSql Update statement: UPDATE [Rohstoff] SET [StdPreis] = @U_StdPreis, [Laenderkz] = @U_Laenderkz, [Eannr] = @U_Eannr, [TestRohstoff] = @U_TestRohstoff, [Teilenr] = @U_Teilenr, [Tmatchcode] = @U_Tmatchcode, [Notiz] = @U_Notiz, [InWert] = @U_InWert, [Teilebez1] = @U_Teilebez1, [DurchPreis] = @U_DurchPreis, [Zusatztext] = @U_Zusatztext, [BezPreisLetzt] = @U_BezPreisLetzt, [Teilebez2] = @U_Teilebez2, [BezPreisDurch] = @U_BezPreisDurch, [BeschaffSchl] = @U_BeschaffSchl, [Statschl] = @U_Statschl, [Zeichnungsnr] = @U_Zeichnungsnr, [Zolltarifnr] = @U_Zolltarifnr, [Refnr] = @U_Refnr, [Artikeltyp] = @U_Artikeltyp, [LifecycleStatus] = @U_LifecycleStatus, [Teileart] = @U_Teileart, [Sichgrp] = @U_Sichgrp, [IDMultiString] = @U_IDMultiString, [NDOTimeStamp] = @U_NDOTimeStamp WHERE ([NDOTimeStamp] = @U_Original_NDOTimeStamp AND [ID] = @U_Original_ID)\nSql Insert statement: INSERT INTO [Rohstoff] ([ID], [StdPreis], [Laenderkz], [Eannr], [TestRohstoff], [Teilenr], [Tmatchcode], [Notiz], [InWert], [Teilebez1], [DurchPreis], [Zusatztext], [BezPreisLetzt], [Teilebez2], [BezPreisDurch], [BeschaffSchl], [Statschl], [Zeichnungsnr], [Zolltarifnr], [Refnr], [Artikeltyp], [LifecycleStatus], [Teileart], [Sichgrp], [IDMultiString], [NDOTimeStamp]) VALUES (@ID, @StdPreis, @Laenderkz, @Eannr, @TestRohstoff, @Teilenr, @Tmatchcode, @Notiz, @InWert, @Teilebez1, @DurchPreis, @Zusatztext, @BezPreisLetzt, @Teilebez2, @BezPreisDurch, @BeschaffSchl, @Statschl, @Zeichnungsnr, @Zolltarifnr, @Refnr, @Artikeltyp, @LifecycleStatus, @Teileart, @Sichgrp, @IDMultiString, @NDOTimeStamp)"

As you can guess the field "Notiz" is the one in trouble.

I tried also to set the ColumnLength property and to set the IgnorLengthInDDL property.

Do you have any idea?

Greetings,

Michael
 6/28/2007 9:18:10 AM
mig
9 posts


Re: nvarchar(max)
Now I tried again. It works?!?
 6/28/2007 10:18:56 AM
Mirko
109 posts
5th


Re: nvarchar(max)

Hi Michael,

sorry for not answering earlier. Currently I'm heavily involved in some project work.

As far as I remember, nvarchar(max) should work without a length restriction. I don't know, what the reason for the failure might be. Maybe, you left accidentally a ColumnLenght attribute in the mapping file?

In any case the NDO logging mechanism can help you resolving such situations. Just write:

pm.LogAdapter = new NDO.Logging.ConsoleLogAdapter(); // Or choose another log adapter
pm.VerboseMode = true;

After executing this lines, NDO lists all ADO.NET commands together with it's parameters. For the parameters you can see the Size property. The size property must be 0, if you don't want to specify a size.

The combination of setting a ColumnLength attribute and IgnoreLengthInDDL causes NDO to set the Size property to the given value while it ignores the ColumnLength in the DDL code.

Best Regards:
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  nvarchar(max)...
  SearchSearch  Forum HomeForum Home