CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    47

    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 !

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    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.

  3. #3
    Join Date
    May 2007
    Posts
    47

    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

  4. #4
    Join Date
    Apr 2006
    Posts
    220

    Re: Reduce the size of database

    yea, thats a good idea. you can save zipped contents and read them as byte array.

  5. #5
    Join Date
    May 2007
    Posts
    47

    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 ?

  6. #6
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    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.

  7. #7
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Reduce the size of database

    Quote 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
  •  





Click Here to Expand Forum to Full Width

Featured