|
Hi,
I have very peculiar problem regarding GZipStream class under System.IO.Compresion namespace.
The problem is like this:
I have an ArrayList with large amount of data. I want to serialize it after compressing it. I used the following algorithm:
1. Create a MemoryStream
2. Serialize the ArrayList into that stream.
3. Compress the memorystream
4. Write the compressed stream into a file.
this runs ok without any error. but problems occur when I want to deserialize it after decompression as follows:
1. Create a file stream from the file.
2. Decompress it into a memorystream
3. Deserialize the stream into an ArrayList
exception is thrown here, it say somesort of like this: Binary header broken cannot deserialize from the stream. This is a peculiar problem, the compression process is not reversible! I don't know how to get rid of this problem. Anyone please help me.
Thank's in advance.......
With regards,
Anindya Chatterjee
|
|
|
|
|
hi
i have CrystalReports XI and VS2005.
i want to print my form with CrystalReports .. but i don't know how to do .. Please help me !!
thanks ..
|
|
|
|
|
Good day
Im having a problem passing an object from one form to another. Im trying to achieve this by passing it through another form's constructor. It does not give me any errors but the form im passing the object to doesnt show anything. all my controls disappear, it's like a new created form.
Am i doing this the wrong way and which is the right way to do it.
Thank you in advance
Kulile --- RSA
|
|
|
|
|
kulile wrote:
Im having a problem passing an object from one form to another. Im trying to achieve this by passing it through another form's constructor. It does not give me any errors but the form im passing the object to doesnt show anything. all my controls disappear, it's like a new created form.
Am i doing this the wrong way and which is the right way to do it.
Without seeing your code, it is hard to spot what you are doing wrong. Have a read of
this article[^] which shows the best ways of passing information from one form to another.
|
|
|
|
|
Thanks Michael. I found what the problem was. I was doing everything right except that in my new constructor, I didn't call the InitializeComponent(); method. that was the problem.
Thanks again
Kulile --- RSA
|
|
|
|
|
Hello,
I want to create control(s) that would act like MS office 2007, so that when you press ALT key all controls that have hotkey will be repainted with hotkey drawn on itself.
I dont want to use KeyDown, KeyPress, KeyUp events.
Could it be all done trought some kind of extending of controls or so ?
overriding WndProc or so ?
Thanks.
|
|
|
|
|
You could override the control classes, or you could use CreateGraphics to draw your keys direct to the screen, then call Invalidate in the key up, so the form gets repainted.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Chris,
Yes I want to paint them on control but how to handle pressing of ALT+KEY ?
I dont want to use KeyPress, KeyDown events?
|
|
|
|
|
Vertyg0 wrote: I dont want to use KeyPress, KeyDown events?
Why on earth not ?
You can use a WndProc to catch these events earlier, but you really have no option but to use them, you want to catch when a key is down, and when it's raised again.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello
You can set a property called KeyPreview to true in your form itself. Then handle KeyDown event in the Form level. It will catch any KeyDown events in any control in that form before it is sent to that control.
Regards
|
|
|
|
|
Try adding & in front of the letter that will be the hot key
Do your best to be the best
|
|
|
|
|
Hello. I am developing some classes that access SQL and Oracle databases.
These classes are to be used by different applications, (windows and web applications).
Thus, I need to put the database connection strings on a global location so that all applications see them (this way if I need to do changes to a connection string all applications are affected).
I found that machine.config might be a proper location to do that, under the <connectionstrings> section.
- Is machine.config a good solution for global connection strings?
- If so, how can I access the <connectionstrings> section in my code?
Thanks.
|
|
|
|
|
|
Dim loConn, lsSQL, loRs
Set loConn = CreateObject("ADODB.Connection")
' Open a connection to the database
loConn.Open("DSN=myDSN;UID=something;PWD=Something;")
' Insert a new record into the table
lsSQL = "SET NOCOUNT ON;" &_
"INSERT INTO tMembers (MemberName) VALUES ('Manohar');" &_
"SELECT @@IDENTITY AS NewID;"
' Execute the SQL statement
Set loRs = loConn.Execute(lsSQL)
' Get the inserted ID
llID = loRs.Fields("NewID").value
' Close the connection
loConn.Close()
Set loConn = Nothing
Hi guys,
What would be the equivalent code of the the above in C#? I have used ADO.NET a bit. How would i have to access the returend value (NewID). Would i have to pouplate a dataset or something? Is there a simple way to access single values returned by a database such as
SELECT DISTINCT store_name FROM Store_Information WHERE id = 5
Thanks!
|
|
|
|
|
The SQL would stay essentially the same in ADO.net.
Use an OledbCommand (or SqlCommand if using SQL Server) and do MyReader = mYcommand.ExecuteReader();
A datareader is analogous to a forward-only ADO recordset. I your examles above, you are reutuning recorsets that just happen to have only one row, one column. A datareader would do the same.
|
|
|
|
|
hello all,
I want Compress a folder that contain some files and subfolders.
how can i do it in visual C#.Net
-- modified at 6:36 Sunday 1st October, 2006
|
|
|
|
|
|
See here[^] maybe its some helpful for you
|
|
|
|
|
hi,
I want to use timer in my service ,but the timer never starts although i have put the start code of the timer in the onstart() method of the service.
|
|
|
|
|
I guess you're using the System.Windows.Forms.Timer . This one won't work as your service has no message pump. Try the System.Timers.Timer or System.Threading.Timer .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello.
I want to make an array of several controls for example buttons in my windows application.
is that possible in VS 2005?
Thanks everyone.
Please, Send me an answers to t_nedelchev@abv.bg.
t_nedelchev@abv.bg
|
|
|
|
|
Sure you can. Simply declare the array and assign a new or existing Button reference to it.
Button[] buttonarray = new Button[5];
for (int i = 0; i < buttonarray.Length; i++)
buttonarray[i] = new Button(); If you create the buttons dynamically don't forget to add them to the controls collection of your form or any container in it, so they get displayed.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks for your fast reply, Stefan.
I wrote the code above.
this creates buttons, but they are invisible.
after your piece of code i wrote the following:
buttonarray.Location =...
buttonarray.size = ....
buttonarray.name = ...
buttonarray.tabindex = ...
buttonarray.text = ....
buttonarray.visible = ...
but again without success - there no buttons on my form.
what do i miss?
thanks.
|
|
|
|
|
As I said you have to add them to the controls collection of your form or any container in it. After all buttons are created, add the following line:
this.Controls.AddRange(buttonarray);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Dear Stefan Troschütz, Thanks a lot. I made it.
|
|
|
|