edit a varchar(max) value give me a "String or binary data would be truncated" error
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



edit a varchar(max) value give me a "String...Expand / Collapse
Author
Message
Posted 05/05/2008 4:07:08 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 1:46:02 PM
Posts: 103, Visits: 580
I have a "Valor" field (varchar(max)) on a "configuraciones" table, I can save the first time some data, but when I try to edit this same data (I find it with a seek and then edit the data and save it), I get an error "String or binary data would be truncated"

I try to alter this with a empty "" string and save it and it give me error anyway

I set debugon on the datasource and I see this:

[Deleted print out --- killed the page ]

I not sure if this are a bug, I save some new data (aprox 30000 bytes, with a base64 string from a memorystream of a devexpress grid savelayout method), edit this with some value and the "truncate" error happen :/

I will try with a text field and a fixed varchar value (something like 50000)

Additionally to this when I used the method "SetDebugOn" on my datasource with the 2nd parameter on true (overwritefile) If the file not exist it give me an error. (I not sure if the method have to create the file if it not exist)

Thanks for the great support.

-Fabian

Post #16156
Posted 05/05/2008 4:46:11 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
The problem is that you are using AllFields for your concurrency checking and have a MAX field.  If you want to allow this MAX field to be inclusive of the concurrency checking, then you need to use a row version field or time stamp field...which is far better anyway.  You can only take a VarChar(8000) as the max length on concurrency checking for All Fields.

Really if you want to use concurrency checking, you should be using Row Versioning anyway.  Create an integer field in the DB, and then specify this field name in the CRUD settings of the BO.

Post #16159
Posted 05/06/2008 8:10:12 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 1:46:02 PM
Posts: 103, Visits: 580
I have to say Sorry 2 times, 1 for the paste of the debug htm (I doesn't known that it can break the page ) and another for my lack of knowledge about some topics, one of them that I forgive are concurrency stuff

I put a int "RowVersion" field, on the BO set UpdateConcurrencyType to "rowversion" and set RowVersionOrTimestampColumn to "RowVersion" and all worked fine many thanks.

- Fabian
Post #16171
Posted 05/06/2008 8:47:15 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
Fabian,

Please don't think I was upset in any way!!!  Absolutely no big deal at all.  As for the concurrency, I am glad that you found what you needed...you will be far better off using RowVersion checking versus AllFields anyway!

Post #16173
« 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:54pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 9 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.