Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


SQL Server & AttachmentCollection C#

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

funmonkee
Super Spammer



Joined: 27 May 2004
Karma :

PostPosted: 15:14 - 14 May 2009    Post subject: SQL Server & AttachmentCollection C# Reply with quote

Hello! Long shot... Has anyone stored a AttachmentCollection (from System.Net.Mail...) in an SQL Table column (image , etc).. via a stored procedure Question
____________________
**** Don't ride faster than your angel can fly Get this Free Space
The democratically elected Mod of the Scottish Section - The Peoples Choice[b]
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Dawdles
Derestricted Danger



Joined: 19 Apr 2008
Karma :

PostPosted: 19:29 - 14 May 2009    Post subject: Reply with quote

Without knowing that specific class itself, i'd probably attempt serializing into a steam (memorystream or perhaps a GZipStream), then blobbing it. Would that be good enough?
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

funmonkee
Super Spammer



Joined: 27 May 2004
Karma :

PostPosted: 19:35 - 14 May 2009    Post subject: Reply with quote

Thanks for the reply Thumbs Up

Yeah that's where I was leaning. However, since I can't control the version and internals/serialization of those MS classes, I might create my own versions... that way I can be sure in the future I can manage the conversions... and not feck the database.

I'm just lazy and wanted someone to give me an easier solution Karma
____________________
**** Don't ride faster than your angel can fly Get this Free Space
The democratically elected Mod of the Scottish Section - The Peoples Choice[b]
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

funmonkee
Super Spammer



Joined: 27 May 2004
Karma :

PostPosted: 20:44 - 17 May 2009    Post subject: Reply with quote

Update: I did have to create a mirror of the intersting information in System.Net.Mail.MailMessage.Attachment. The Attachment object can't be serialised, but my version could (1 liner). I then just converted my object array to binary stream and stored in an image column. I convert back from the binary/image stream to my object array...sorted Thumbs Up
____________________
**** Don't ride faster than your angel can fly Get this Free Space
The democratically elected Mod of the Scottish Section - The Peoples Choice[b]
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 16 years, 292 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.05 Sec - Server Load: 1.49 - MySQL Queries: 13 - Page Size: 40.5 Kb