Beispiel #1
0
        private static SqlLongString CreateData(IQuery query, byte[] data)
        {
            var lob = query.Session.CreateLargeObject(2048, true);
            using (var stream = new ObjectStream(lob)) {
                stream.Write(data, 0, data.Length);
                stream.Flush();
            }

            lob.Complete();
            return SqlLongString.Ascii(lob);
        }
Beispiel #2
0
        private static SqlLongString CreateBio(IQuery query, string text)
        {
            var lob = query.Session.CreateLargeObject(2048, true);
            using (var stream = new ObjectStream(lob)) {
                using (var streamWriter = new StreamWriter(stream, Encoding.ASCII)) {
                    streamWriter.Write(text);
                    streamWriter.Flush();
                }
            }

            lob.Complete();
            return SqlLongString.Ascii(lob);
        }
Beispiel #3
0
 private void WriteToObject(ILargeObject obj, Encoding encoding, string text)
 {
     using (var stream = new ObjectStream(obj)) {
         using (var streamWriter = new StreamWriter(stream, encoding)) {
             streamWriter.Write(text);
             streamWriter.Flush();
         }
     }
 }