You can use the VARBINARY(MAX)
field type in SQL Server, if you like. You can store any type of object in there, up to 2 GB in size.
To access it, you can use ADO.NET - something like this:
object yourMysteryObject = (whatever you like it to be);
MemoryStream memStream = new MemoryStream();
StreamWriter sw = new StreamWriter(memStream);
sw.Write(yourMysteryObject);
SqlCommand sqlCmd = new SqlCommand("INSERT INTO TableName(VarBinaryColumn) VALUES (@VarBinary)", sqlConnection);
sqlCmd.Parameters.Add("@VarBinary", SqlDbType.VarBinary, Int32.MaxValue);
sqlCmd.Parameters["@VarBinary"].Value = memStream.GetBuffer();
sqlCmd.ExecuteNonQuery();
Marc
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…