|
Thank you very much Luc Pattyn!
that will really help me....
I would like to go through the articles here.... But with so many of them, I find it a bit difficult to chose....
Thanks for the advice
You don't have to be AFRAID!
|
|
|
|
|
Hi,
In my C# application, I'm getting a dataset from the database for transport to excel. In the data set there is a date column. While writing to excel it is giving an entire different format, whereas in dataset it is coming correctly. For eg:
if in the dataset suppose the date is 03/12/2006, while writing to excel it is writing as 2006-12-03T00:00:00.0000000+05:30. I don't know how this is happening. I'm using RKLib dll for exporting the data to excel. Anybody who knows will you please help? This is urgent.
Thanks,
Meeram395
|
|
|
|
|
hi friend use this format
CONVERT(VARCHAR(15),AC.CGO_RVD_DAT ,103)
|
|
|
|
|
I have been searching google for an answer for this, and maybe i just dont know how to proeprly word my search, but I have come back with nothing useful. My issue:
I have been playing around with the System.IO.Compression namespace, and have noticed an interesting little behavior:
Compressing files that are already in a compressed format (example: jpg, mpg, zip) or have been encrypted with System.Security.Cryptography, come out of the compression BIGGER than when they went in.
I was wondering if anyone A. knows why this happens, and B. knows a way around it
If there is no way around it, then my code has to be modified to exclude formats that might have this issue, but it would be swell to be able to just compress the buggers.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Since you are compressing something that is already compressed, then you won't be able to make it smaller. But while compressing the second time, the code still needs to add a header to decompress it. So if the original data has X bytes, then the compressed version would (approximately) have X + Y, where Y is the header.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Great! I know it seems weird that I would be excited, but as long as I understand what is going on under the hood, I can work around it.
That is a huge help. So I have to specify which files will be compressed and which wont, Oh Well.
if i didnt like to code, i wouldnt do this for a living
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Assuming the compression is not expensive (e.g. you are only working with small streams), then you could simply code the method such that it tries to compress the data. Then it would compare the original size to the compressed size and if the compressed size is larger, then it saves the original data and trashes the compressed data. You would probably need to maintain a flag with the file that specifies whether you compressed it though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I have a pretty good idea of which filetypes are compressed or not, so i will probably integrate what you suggested with an enum or something that will look at the extension. The code i am writing will possible handle hundreds of files at a time, and any memory overhead i can save will be good.
Thanks again for your help, you have saved me a headache.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
This is fairly typical. Once a file has been compressed, compressing it again very rarely makes it smaller still. As Tom pointed out, the second compression adds additional header information to the file, which ends up making it bigger. There really isn't a way around this.
|
|
|
|
|
Hi,
the best way to compress a collection of files is to turn them over all at once to one of the
popular compression utilities such as WinZip. You will then again notice that some files
don't get extra compression (such as ZIP files!), but the overhead will be minimal and mostly
shared.
The command line interface to WinZip requires a separate install, once installed you can
call it using Process.Start().
There also are Zip libraries available (such as ZLIB), search the CodeProject articles.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Great suggestion, however, the issue i have is that each file is to be saved to a database, and each file has to be its own seperate entity. The other thing is that i cant have the user installing a seperate utility, it needs to be all in one package.
I already have an interface in the works for saving the files, so modifying the code for "non-compressable" formats should be a cinch.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
OK.
One way for predicting compressability is by performing a simple statistical analysis:
take part of the file (say the first 1KB) and make a histogram on the byte values.
If the histogram is very flat, chances are compression wont buy you anything;
if a lot of byte values occur very (in)frequently, compression should work well.
One measure could be:
int infrequent=number of values occuring less than samplesize/512;
int frequent=number of values occuring more than samplesize/128;
bool compression_will_work=infrequent+frequent>64;
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Food for thought. If nothing else, it will give me something to play with ]
thanks again!
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
here i am using asp.net
how we can search the data in directories
with regards
sunil
|
|
|
|
|
sunilwise wrote: how we can search the data in directories
do you mean how do you get the physical path to a directory? or what kind of data?
Do your best to be the best
|
|
|
|
|
hi ...
i want to save my program setting in a xml file.
i create most of things for create, read, write but i don't know how can update a node value in xml with C#.
can you help me?
thanks.
|
|
|
|
|
Here you have a sample in C#
http://eai.ittoolbox.com/groups/technical-functional/xml-l/update-xml-element-value-using-cnet-1328886
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
hi "il_masacratore"
thanks so much.
i visited your reference. it was good.
and i visit your blog. unfortunately i can not your blog (because language).
and then click "Create Blog" link on top - right corner. then go to create blog page and show my google id and name. it was so interest for me .
is it use of google information?
if yes, do you know how can use of such google information ?
|
|
|
|
|
in my search , found follow link that think is very good for beginners XML.
http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fwww.codeproject.com%2Fsoap%2FXmlHelper.asp&ei=228BR6zIKp2MeqP0nOUC&usg=AFQjCNFZG4M2LEqCk5J-QpMH73WjSxSE_w&sig2=zk0Ml3YxmDchiDyTVtD46Q
|
|
|
|
|
i have done a simple login page web application. which is working perfectly but now i want to add change password option for the user after logging in into the page.
I have encrypted the password and stored in the database. the datatype i have given for password is binary, i am using stored procedures. For converting the binary value password i have used casting and converting keywords in sql server 2000
can any one help me to write the code for changing password option .
|
|
|
|
|
sunilwise wrote: can any one help me to write the code for changing password option
How much different can it be from the code that initially sets the password? Surely it just changing the INSERT into an UPDATE? (more-or-less)
|
|
|
|
|
hi. guys kool .
How can i make a self excutable file in console or windows application in c sharp.
thanks to all that help me
so much of happy ending...
|
|
|
|
|
What do you mean?
The result of compiling a Console or Windows project is an executable file.
Paul Marfleet
|
|
|
|
|
I have mentioned "Self excutable file"
which mean it should run automatically on a certain situation without clicking the icon.
so much of happy ending...
|
|
|
|
|
What situation? You haven't explained what you are trying to do.
If you want to launch an executable programmatically, have a look at the Process[^] class.
Paul Marfleet
|
|
|
|