Saturday, March 31, 2007

Saving large text to database field.

  1. System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
  2. MemoryStream mr = new MemoryStream();
    bf.Serialize(mr, strCode);
  3. byte[] bt = mr.GetBuffer();

assign this bt to the param.Value to be passed to the sqlhelper.

No comments: