Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have a PetaPoco-Database in which I want to save complex Search-Querys in Form of a single String.
Sadly the String seems to long and I don't know how to allow for longer NVarChars. Can someone help?
[TableName("SavedSearches")] [PrimaryKey("Id", autoIncrement = true)] public class SavedSearches { [Column("Id")] [PrimaryKeyColumn(AutoIncrement = true)] public int Id { get; set; } [Column("CreatedOn")] public DateTime CreatedOn { get; set; } [Column("UserId")] public string UserId { get; set; } [Column("Query")] public string Query { get; set; } [Column("Name")] public string Name { get; set; } }
Comment author was deleted
You could add the additional attribute [SpecialDbType(SpecialDbTypes.NTEXT)]
This works for me. Can I somehow controll the maximum length in the Database?
Not with attributes I think but you could do it manually on the db table column once it's created
You can user [Length(256)] to control ... length.
Ow didn't know that, thanks for sharing!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Peta Poco Annotation
Hi,
I have a PetaPoco-Database in which I want to save complex Search-Querys in Form of a single String.
Sadly the String seems to long and I don't know how to allow for longer NVarChars. Can someone help?
Comment author was deleted
You could add the additional attribute [SpecialDbType(SpecialDbTypes.NTEXT)]
This works for me. Can I somehow controll the maximum length in the Database?
Comment author was deleted
Not with attributes I think but you could do it manually on the db table column once it's created
You can user [Length(256)] to control ... length.
Comment author was deleted
Ow didn't know that, thanks for sharing!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.