Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
Format.Native with Sql Server 2005 - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, MonoTouch for iPhone, MonoDroid for Android, and Windows Azure.

News

Personal Blog

Work Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Archives

Format.Native with Sql Server 2005

One of the things that I have learned (the hard way) when dealing with a user defined aggregate is that your code should use Format.Native as the native serialization format.  The will result in your data being formatted with the native Sql Server binary serialization.  There a couple of problems with this format.

  • Lack of flexibility.  All public properties must be fixed length value properties.  Strings will not work.
  • The structure layout for your strucutre must be set to Sequential like this: StructLayout(LayoutKind.Sequential).  BTW, you then need to include/import the System.Runtime.InteropServices namespace.

Format.Native is the fastest serialization format, but also the most limiting.  What are your other options?

  • SerializedWithMetaData.  You probably want to stay away from this format as Microsoft has already marked this as going away.
  • Structured.
  • Unknown.
  • UserDefined.

Comments

TrackBack said:

# November 15, 2004 7:16 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)