Compressing RTF For Database

Aug 22, 2011

I am developing an application where the user saves a chosen RTF file to a SQL Server database. My problem is that if the file contains an image, the binary becomes too big. Although the database has enough space, it's not very nice to use up space you could save.... To give an example:

[Code]...

View 2 Replies


ADVERTISEMENT

Compressing RTF For Database?

Aug 22, 2011

I am developing an application where the user saves a chosen RTF file to a SQL Server database. My problem is that if the file contains an image, the binary becomes too big. Although the database has enough space, it's not very nice to use up space you could save....To give an example:

RTF binary with two text lines ("ABC / efg") = 156 Bytes
Same 2 lines + 32 kB image = 2.2MB

I am still confused on which is the best way to solve this. I have thought about creating an "images" table in my database and using a markup to fetch the image when the file is loaded.

View 8 Replies

Compressing A Database To A Single File?

Jun 4, 2010

In my contact manager program I have been storing information by reading and writing comma delimited files for each individual contact, and storing notes in a file for each note, and I'm wondering how I could go about shrinking them all into one file effectively. I have attempted using data entry tools in the visual studio toolbox and template class, though I have never quite figured out how to use them. What would be especially convenient is if I could store data as data type IOwner (a class I created) as opposed to strings.

I'd also need to figure out how to tell the program what to do when a file is opened (I've noticed in the properties how to associate a file type with the program though am not sure how to tell it what to do when it's opened).

Edit:

How about rephrasing the question: I have a class IContact with various properties some of them being lists of other class objects. I have a public list of IContact. Can I write Contacts as List(Of IContact) to a file as opposed to a bunch of strings?

Second part of the question: I have associated .cms files with my program. But if a user opens the file, what code should the program run through in an attempt to deal with the file? This file is going to contain data that the program needs to read, how do I tell it to read a file when the program is opened vicariously because the file was opened?

View 2 Replies

C# - Worth Compressing The ViewState?

Nov 16, 2010

I agree that the best way to shorten the ViewState is to disable it on the ASP.Net controls that don't need it. Keeping it small from the beginning is a great habit.I have also heard that it is already compressed (although can be true... there are ways of compressing it even more, has described in this Stack Overflow question).

My question here is not if it should be compressed... is: when should ViewState be compressed?If we have a ViewState of 410 characters it will weight 410 bytes in a page, while a ViewState of 13.843 characters equals 13.5 KB.

13.5KB is a considerable weight already. And if I compress a CSS file that height 10KB, I think it is also worthy compressing a ViewState of 13.5KB, even if that means a little extra "thinking" on the server.

But is 410 bytes of ViewState worth the extra processing on the server?At what point is it worth compressing?

View 2 Replies

CGZIPLibrary.dll Not Compressing Files?

May 27, 2011

I am using CGZipLibrary.dll in my code for zipping the files. A .zip file is being created but the file is not getting compressed. The original file and the .zip file are of same size.

View 1 Replies

Compressing A Stream Rather Than A File?

Apr 3, 2010

I've downloaded ZLIB.NET from here and the example VB.NET code they provide works fine. It's very short so I'll paste it here for reference:

vb
Public Shared Sub CopyStream(ByRef input As System.IO.Stream, ByRef output As System.IO.Stream)
Dim num1 As Integer

[Code]...

Note that the CopyStream() subroutine is identical. The problem is that although decompressing seems to work fine, compressing does not. If I take a byte stream, compress it and then decompress it using the above code, I get a truncated version of the original stream (as an example, a 360485 byte stream becomes 311518 bytes). The resulting bytes match the original stream up until the point where it's cut off.

The only information I can find about streams being truncated is due to missing stream.Flush() commands but the output stream is flushed in the CopyStream() subroutine.

View 5 Replies

Compressing Memory Streams?

Jun 24, 2009

I have this code for compressing datasets into files:

Using fs As New System.IO.FileStream(flnm, IO.FileMode.OpenOrCreate, IO.FileAccess.Write, IO.FileShare.Write)
Using zStrm As New System.IO.Compression.GZipStream(fs,

[code].....

View 1 Replies

Compressing Multiple Sub Folders?

Oct 26, 2011

I've written a backup utility for one of our applications; this process involves coping sub directories of a specified base folder and an unknown number of folders within folders. I've got the process down to copy the files and directories pretty easily but I want to compress the folder structure to keep the space needed as small as possible.I've found a few utilities that work well for getting the files from the specified base folder but not any of the folders that exist in the specified start directory.The one utility I found required me to recursively search directories for the variably named directories and I am hoping for a simple switch that can be used that says base folder/file and sub directories.

View 1 Replies

Compressing Sql Server Data Across Vpn?

Aug 16, 2009

compressing sql server data (on the fly) from a select statement when accessed across the internet. i.e data is stored in Sql Server Express on a remote computer (1) connected via an Internet VPN. An application on a remote computer (2) on the same VPN sends a select statement to the SQL server machine.The data would then be compressed at computer (1) sent across the VPN and decompressed at computer (2)

The Reason is, broadband speeds are not the greatest in Australia, and it would reduce the size of the data transmitted, resulting in faster response, as the compression/decompression is done at each machine

View 1 Replies

Compressing Normal Files Into A EXE Created By VB?

Apr 2, 2009

I am need of creating a windows executable that contains a compression of certain other binary files, (executables etc)

It is a basic form with a button, on press of the button, it has to decompress certain binary files( some other executables too) into a certain path, the decompression happens based on some specific conditions and not always., This is the reason I could not use WinZIP to create the EXE.

View 3 Replies

Storing Files Into An Application Compressing Them And Then Extracting Them?

Apr 8, 2009

How could I go about doing this if I can? Storing files into an application compressing them and then extracting them?

View 1 Replies

VS 2008 Compressing / Decompressing Entire Folders

Apr 1, 2010

How do you do it? I've looked it up everywhere and failed to find anything. If there is a previous post I missed that discussed this, post it as a comment and forgive me. <scenerio>Friend and I are working on a VB project. We want to export and inport folders of information, and to do so neatly, we wanted to compress the files in the format we made for our program, then be able to decompress it within the program as well. If theres any other way to do this without compression and decompression

View 2 Replies

VS 2005 - Compressing A Dataset Converted To XML Using The GZipStream Class Added In 2.0

Mar 25, 2009

I am compressing a dataset converted to XML using the GZipStream class added in 2.0. There are a few things bothering me about this. Here's the code I am using to decompress the XML file:

Using inFile As New System.IO.FileStream(flnm, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
Dim zStrm As New System.IO.Compression.GZipStream(inFile, IO.Compression.CompressionMode.Decompress)
Dim buff(999) As Byte

[CODE]...

This seems inordinately awkward, as I am taking the stream, reading it out into byte buffers, then writing those byte buffers to a memory stream that is then passed to the dataset.ReadXml() method. The reason for this seems to have to do with what is happening in the line colored red. That line is adding a closing > onto the end of the stream. Without that, ReadXml complains about an unclosed dataset. I found out that the > was missing by writing the stream into a string and pasting the string into WordPad. Without that missing >, it appears that I wouldn't need to be using that memory stream at all, and could simply pass in the GZipStream to ReadXML, but as far as I can tell, it's impossible to look at the GZipStream to be sure that the > is not there, and it may be impossible to add it (I haven't tried).

So why is the > missing? Here's the code used to create the file that is being read into the filestream in the above

VB Using ms As New System.IO.FileStream(flnm, IO.FileMode.OpenOrCreate, IO.FileAccess.Write, IO.FileShare.Write)
Dim zStrm As New System.IO.Compression.GZipStream(ms, IO.Compression.CompressionMode.Compress)

ds.WriteXml(zStrm, XmlWriteMode.WriteSchema)
End Using

The real kicker to all of this is that while I was dissecting the first chunk of code, I added a line to check for cnt<1000. My intention was to see the last buffer that was being written into the memory stream to see whether the final > was actually there, or not. To my surprise, I reached the cnt<1000 twice. That means that one read did not read a full 1000 bytes, but read only 675. The next three or four reads were a full 1000 bytes, then the final read was just a few hundred bytes. It is my understanding that Read will return a full buffer if there are that many bytes left to read, and there were, so why did it return only a partial buffer? That suggests that there might be a hole in my XML, though with a half meg file, it's a bit much to read through it looking for something missing. However, the XML that was returned was turned into a dataset that I then merged into some existing data using code that has been working with uncompressed XML files, and I got an error that I should never have received. That may indicate that the XML was, in fact, missing something, though I will have to study the matter further to figure out whether or not that is the case. My major question has to do with the missing '>' at the very end of the file.

View 2 Replies

Make A Compressing Program Such As "winrar" Or "winzip"

Nov 22, 2009

I want to make a compressing program such as "winrar" or "winzip". i want to make it in basic language. i'm using VS 2005 .net

View 8 Replies

2005 - Login With Database - Only Get Latest Data On Username And Password Column On My Database

Jan 14, 2011

I have code on log in form but it only get the latest data on username and password column on my database

Here is my code

Public Class Users
Dim MyLogIn As New myRecords

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

[CODE]...

This is my connection:

Imports MySql.Data
Imports MySql.Data.MySqlClient

Module myconnect

[CODE]...

This is my record:

Imports System
Imports System.Data
Imports MySql.Data
Imports MySql.Data.MySqlClient

[CODE]...

View 1 Replies

Add An SQL Database File Using VS 2005 Getting Error Message Saying Version Of Database Server Not Supported?

May 18, 2009

I recently upgraded the MS SQL Server installed on my personal computer from 2005 Express to 2008 Express. Problem is when I try to add an SQL database file to a project using VS 2005 I get an error message saying that the version of my database server is not supported, I must have SQL Server 2005 Beta 2 or later installed. I didn't do it yet but I'm pretty sure that when I open the other projects that I included a database file to it, I'm going to get the same error.
My question is it possible to have two SQL Servers installed on my machine? If so, is it a good idea to have two DB servers in the same machine?

View 1 Replies

DB/Reporting :: OLE Database Access - Move My Programs And The Database To Another Computer And Hard-disks

Apr 21, 2008

I want to move my programs and the database to another computer and hard-disks. It looks to me as though I nearly have to re-create the controls and rewrite some of the code to make it so the programs still work after the move. At least with ODBC all I would change was the DSN definitions external to the programs. Is there an easy way to move or rename a database without loads of work?

View 3 Replies

MS Access Database To Make Program Interactive But Cannot Get The Database To Update With The Entered Data

Apr 20, 2010

This program is very difficult for me, but I must get threw it or I cannot finish... What I am doing is making a Database of foreign Languages with the spelling of the words and the pronounciation inside the database... The USER enters a paragraph of words into the translator textbox and pushed translate. The program has a DATABANK of words with the phonetic spellings and matches the word, then translates to phonetics. The problem is that new words keep appearing inside the language. So I incorporated a Database of 2 fields

[Code]...

View 4 Replies

Use 'Data Source' Tab To Create Database Will That Database Be Automatically Created / When Use Software On Another Machine?

May 18, 2010

When I am developing an application and I use the 'Data Source' tab to create a database, will that database be automatically created when I use the software on another machine?

View 1 Replies

Add A Remote SQLServer Database To My Database Explorer Window In 2010 Express?

Feb 14, 2011

I'm trying to use LINQ to SQL in Visual Basic 2010 Express.

It allows me to create the .dbml file, but in order to drag items from the Database Explorer window to the design surface, I first have to get my database listed in the Database Explorer!(this is a remote SQL Server database - not a local .mdf)

I already have a good, working connection string to the remote SQL Server database, but that doesn't help me when I'm trying to generate the DBML at design time.

Can anyone tell me how to get my remote SQL Server database identified in the Database Explorere window? When I try the "Add Connection", I am limited to Access, SQL Server Compact, or SQL Server Database File. If I try to enter the IP address & port of my DB Host I get a 'database file does not exist' message. Doesn't seem to want to let me point to a remote DB server...

View 5 Replies

Database Application Does Not Work On User Machine If Database Is Password Protected?

Jan 20, 2011

In vb.net I am using password protected database with following connection stringconnetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:vaivaiDB.mdb;JetOLEDB:Database Password=secret;"Database access works fine on the development machine.

View 2 Replies

Database Error - Application When Installed, Doesn't Read Values From Database?

Jul 20, 2011

When I install my application, some forms are unable to connect to the database.

I say some because, when my login form works totally fine. Authentication happens.

But once I go into the main application, and open other windows, I start to get these error mesages:

[URL]

View 4 Replies

Developed Database Project On Vb6 Using Adodc And Datagrid Using Ms Access Database File?

Mar 2, 2010

Friends I have Developed my Data base Project on vb6, using adodc and datagrid using ms access database file, it was working nice in vb6, I also put Search box there and used adodc1.recordsource="select * from table" sql query.

later i needed to convert it in vb.net I converted it, every thing is working fine, but one problem appears, an adodc's Recordsource query for searching records is not working, it only works if there is data in dataset (Datagrid),suppose once i pressed search button to search record and if no record found then dataset / datagrid becomes empty, now i wanted to search an other record with other name, but this time it does not work and following error appears Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

[Code]...

View 1 Replies

Firebird Database - Combined All That Data Into One Database File Called RECDATA

Jun 22, 2010

I am sitting with a situation that I have to combined (3 years) for 26 site of 29000 database files where there is 1 table in each data base called RECDATA, I need to combined all that data Into one database file called RECDATA.

For example there is a database called DB1 with a REDATA table inside it, and then DB2 with a RECDATA table inside it, DB3 with a RECDATA table inside it est. So I need to put all the Recdata into 1 Database file, or to copy all the RECDATA from all the database files to 1 RECDATA they all have the same columns All I need is to get all that data into 1 RECDATA table.

The program where this database comes from is a voicerecording system creating a new database every day. There is 1 database just for indexing (to view the recordings) and then the daily database is where the recording lies in, that Colum is called RECFILE. I will give you a example of the 2 database.

View 1 Replies

IDE :: Failed To Retrieve Data From The Database, Database Vendor Code 9421?

Jan 17, 2011

I have a report made in Crystal Reports XI. The report is generated and exported to PDF in visual basic script using COM interface. Generally everything is running smoothly, but in one case generation breaks with error: Failed to retrieve data from the database. Details: [Database Vendor Code 9421]

Database used is MSSQL 2005 connected over ODBC to CR XI. When I am opening report with exactly the same parameters in Designer, everything works fine.It looks like it is data related, but it is hard to trace since the whole report is pretty sophisticated. Anyway I spent half a day on crawling over Dr. Google and it seems that he has no clue what might be an issue.

View 2 Replies

IDE :: Pull Data From Source Database, Manipulate It And Push It Into The Destination Database?

Jan 22, 2009

I have VS 2005 installed in my sytem fyi.We have two databases, say source database and destination database. The databases is in Oracle. Now we need to pull data from Source database, manipulate it and push it into the destination database on daily basis.We are planning to use VB .Net for this and would like to know if this is feasible. Using windows forms through VB .NET, is it possible to create a exe and schedule the exe on nightly basis to pull the data from source to destination.how to do this as for manipulation of data, there is no intermediate database for us?

View 1 Replies

Make A Database Application That Can Write/retrieve Cells/datasets From/to A Database

Apr 8, 2010

i need to make a database application that can write/retrieve cells/datasets from/to a database i buyed a book in there was an example of how to create a database application while debugging i had the "Object reference not set to an instance of an object." error and it highlighted this code

objDataRow = objDataSet.Tables("KlantenTable").NewRow
now the problem is here i declare something later in the code i write to it
objDataSet.Tables("KlantenDataTable").Rows.Add(objDataRow)

[Code]....

View 2 Replies

Save Data In Microsoft Access Database And Retrieving It Back From Database?

Nov 19, 2010

can anyone teach me how to save data in microsoft access database and retrieving it back from database?[code]so, how do i save it in that and how do i load their data by typing their ic no only..

View 5 Replies

Created An Access Database - Display Items In The Database Base On The Criteria Selected By The User

May 29, 2009

I have created an access database which i want to search with vb.net, I tried a few thing but it didnt work as desired.

Firstly the program is suppose to display items in the database base on the criteria selected by the user. what i've succefssfully done so far is I've added a datagrid 2 combobox, 1 (searchcbo) with the columns in the database and the other (searchcbo1) will autoload the items under the column selected in and a button (searchbtn) but i have no clue of the code to put in the button. i also tried the fill method but that didnt work as i wanted to. ultimately i want a combobox with the list of columns and a textbox to enter criteria and of course a search button.

The searchbtn should act as the "WHERE" sql command, e.g. SELECT EmployeeNumber, Firstname, LastName, Phone, Location....etc FROM CallLog WHERE searchcbo.text = searchcbo1.text And display the results in the datagrid.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CallLogDataSet.CallLog' table. You can move, or remove it, as needed.
Me.CallLogTableAdapter.Fill(Me.CallLogDataSet.CallLog)

[CODE]....................

Attached image(s)

View 3 Replies

Database Sql Server Compact Edition 2005 - Save In A Database - Column Cannot Contain Null Values

Oct 15, 2009

Ive created one database Sql Server Compact Edition 2005, with one table ("Cliente") I know that I can created my database good, but i have a problem saving information since three textbox, in my table(With columns "Nombre" "Apellido" "Cliente". In my form there is a button save ("Guardar"). When I do click in my button appear the next message : "The column cannot contain null values. [ Column name = Nombre,Table name = Cliente ] " and happen the same with apellido and Id_Cliente. And this happen becouse my code cant save the information....

This is the code

Option Explicit On
Option Strict On

Imports System
Imports System.IO
Imports System.Data

[CODE]...

And the code for my button is:

Private Sub cmdguardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdguardar.Click

Dim myconnection As SqlCeConnection
Dim mycommand As SqlCeCommand

[CODE]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved