|
-
September 2nd, 2008, 10:12 PM
#1
Reduce the size of database
I have some problem with database size.
I have an table with a blob field ( i use firebird ) .
I have to insert a .RTF file into blob field. So i have read file .RTF into an array of bytes, then insert it into database.
But the problem is the size of []bytes so large.
Is there anyway to reduce the size of database .
Is there anyway to compress file before insert
Please help me !
Regard !
-
September 3rd, 2008, 01:39 AM
#2
Re: Reduce the size of database
You store the rtf separatelly in the filesystem and in the database, you store only "pointer" (guid, path... whatever meets your needs) to the file.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
-
September 3rd, 2008, 02:54 AM
#3
Re: Reduce the size of database
Thank for your idea . But i can't do that way.
i have to bring rtf file into database.
Would you suggest me some way to read a zip file. And then, how to read it again
-
September 3rd, 2008, 03:17 AM
#4
Re: Reduce the size of database
yea, thats a good idea. you can save zipped contents and read them as byte array.
-
September 3rd, 2008, 03:55 AM
#5
Re: Reduce the size of database
I got byte array from blob field, but dont' know how to decompress it and convert it into a string .
I tried GZipStream class but it seem wrong method . Would you please give me some more suggestion ?
-
September 3rd, 2008, 05:01 AM
#6
Re: Reduce the size of database
I use the ziplib library for compressing data. Have a look at it here.
Useful or not? Rate my posting. Thanks.
-
September 3rd, 2008, 05:39 AM
#7
Re: Reduce the size of database
 Originally Posted by iwtbapd
I got byte array from blob field, but dont' know how to decompress it and convert it into a string .
I tried GZipStream class but it seem wrong method . Would you please give me some more suggestion ?
GZipStream has an overhead relatively big, so its only from interest if you have really great files. For example some 100-drets of KB
 Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|