|
You can return the data in 1 query by using the ROLLUP[^] command in your SELECT statement. ROLLUP is used to for producing summary information for a set of rows. In your case, you can use it to produce subtotals for each set of sales records grouped by store.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
ThanksPmar, however, I have used "Rollup" in the SP itself thus the calculation. The result is table[1]. However table[0] counts the transcation based on a different criteria. I got all the information I need from the DB, however it can not be done in single query. All I need is to display the dat from the dataset.
Skan
If you knew it would not compile why didn't you tell me?!?!?!
|
|
|
|
|
Using C#.net express edition I created an application that has the main code in the parent form.
In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar).
I could create a form object from the child object but that would not look as nice.
HELP!
shwa guy
|
|
|
|
|
shwaguy wrote: Using C#.net express edition I created an application that has the main code in the parent form.
In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar).
I could create a form object from the child object but that would not look as nice.
Either have your object fire progress events, which you can wire and use to update your ProgressBar from the main form, or pass the ProgressBar to the object and have it do the update directly. The first method is more code, but vastly preferrable.
If your object uses threads, beware of UI marshalling issues.
Share and enjoy.
Sean
|
|
|
|
|
thanks for the reply.
I still do not know how do what I need to do, but I think I might be on the right path now.
I never had to fire events before, I guess I am about to learn.
shwa guy
|
|
|
|
|
|
Applications don't have IP addresses, machines do. Go study your subject matter and come back after you have gained an understanding of it sufficient for forming your question in a way that it actually makes sense.
led mike
|
|
|
|
|
It should look like this one.
Welcome to The Quiz Program!
You can be quizzed on any of the following operators:
1) % (modulus, or 'remainder')
2) * (multiplication)
3) / (integer division)
4) / % (integer division & modulus in a combined challenge!
Type the number of the operator that you wish to be quizzed on: 1
I will ask you to tell me the result of
A % B
What is the smallest value of A: 0
What is the largest value of A: 100
What is the smallest value of B: 40
What is the largest value of B: 50
How many times do you wish to be quizzed:
3
Ok, we're ready to go!
What is the result of 92 % 44? 4
4 is correct!
What is the result of 92 % 48? 4
Good try, but no: 92 % 48 = 44
What is the result of 18 % 47? 47
Good try, but no: 18 % 47 = 18
Thank you for using this program - have a nice day!
Press the 'Return' key to exit
|
|
|
|
|
|
No one here will write the program for you, but if you need help with writing the program the forums can help. And the program you are speaking of sounds like a basic program.
Regards,
Thomas Stockwell
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.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Looks like homework to me...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When is your homework due?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Here's a quiz question for you:
What happens when someone asks members of a CodeProject forum to do their homework for them?
When you figure out the answer, hopefully you'll understand what you have to do.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hellllooooooo. Hellloooooooo. Can you hear the wind whistling unhindered through the vast emptiness existing between your ears? It must be lonely for your last remaining braincell.
|
|
|
|
|
Hello all,
I have a C# project (.net 1.1) that references a .net dll. When this dll is put in the same folder as the project's executable file, everything works fine.
But I need to put this dll in another folder, not related to the project. I already tried putting it in system32 folder, but it still didn't work. I get a fileNotFound exception.
How can I do that?
Thanks
Peterson
|
|
|
|
|
Hi,
Try to give the dll reference thru browse(eg. say c:\test) not project reference and also make the property CopyLocal as false.
In addition, you give the path (c:\test) in ReferencePath tabe of Project's Property window.
Thanks
Srini
|
|
|
|
|
Hello,
I did this, and the program still can't find the dll.
Thanks
Peterson
|
|
|
|
|
Peterson Luiz,
Why do you want to do this anyways?, Is this dll used over multiple programs?, eg is a lib dll?
Can it be in the same program directory but in another folder?
eg: C:\YourProgy\DllFolder\name.dll ?
Also, when you say it doesn't work when putting it in the system32 folder. Have you built the program and then installed it on a another machine? or just running it in debug?
Regards,
Gareth.
|
|
|
|
|
Hi,
- Yes, I whant to do this because there are other programs using this dll.
- No, I needeed the dll in program files\my folder...
- Yes, I have built the program and tested in other computer.
Any ideas??
Thanks
Peterson
|
|
|
|
|
.NET will look for an assembly (your shared .NET dll) in the same directory as the executable or if it's not found there then the Global Assembly Cache (GAC). So, to share that DLL you'll either have to copy to both EXE directories or install it to the GAC.
|
|
|
|
|
I'm currently writing a little password-manager to store my passwords and the associated data my way.
Of course I would prefer the stored data not to be plainly readable to anyone, so I thought of encrypting it.
However, I couldn't really find any way of doing it elegantly.
1. I want to enter a password of my choice to encrypt it. Rijndael and others always need a key of a specific length, so the choice of passwords is limited to the accepted length .
2. Some methods I found need an input file and an output file. This is not particularly elegant, since one has to erase the input file (encryption) or the output file (decryption) afterwards, in order not to have a plainly readable version. Other methods encrypt a string, while I am serializing objects in a stream.
Here is what I have so far (without encryption):
Saving:
<br />
private void SaveFile(string path) {<br />
Stream stream = null;<br />
try {<br />
stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);<br />
<br />
MemoryStream memoryStream = new MemoryStream();<br />
GZipStream compressedStream = new GZipStream(stream, CompressionMode.Compress);<br />
IFormatter formatter = new BinaryFormatter();<br />
formatter.Serialize(memoryStream, ((PasswordList)ActiveMdiChild).List);<br />
memoryStream.WriteTo(compressedStream);<br />
<br />
compressedStream.Flush();<br />
compressedStream.Close();<br />
} catch (Exception r) {<br />
throw new ApplicationException("File could not be created " + r);<br />
} finally { if (null != stream) stream.Close(); }<br />
}<br />
Opening:
<br />
private void openToolStripMenuItem_Click(object sender, EventArgs e) {<br />
OpenFileDialog openFile = new OpenFileDialog();<br />
openFile.Title = "Open";<br />
openFile.InitialDirectory = Environment.CurrentDirectory;<br />
<br />
if (openFile.ShowDialog() == DialogResult.OK) {<br />
Stream stream = null;<br />
try {<br />
IFormatter formatter = new BinaryFormatter();<br />
stream = new FileStream(openFile.FileName, FileMode.Open, FileAccess.Read, FileShare.Read);<br />
GZipStream compressedStream = new GZipStream(stream, CompressionMode.Decompress);<br />
PasswordList newList = new PasswordList(this, (List<entry>)formatter.Deserialize(compressedStream));<br />
compressedStream.Close();<br />
<br />
newList.MdiParent = this;<br />
newList.filename = openFile.FileName;<br />
InitializeNewList(newList);<br />
} catch (Exception r) {<br />
throw new ApplicationException("File could not be opened" + r, r);<br />
} finally { if (null != stream) stream.Close(); }<br />
}<br />
}<br />
</entry>
Does anyone know an elegant way (not writing the file, encrypting it and then throwing away the original file) to include encryption and decryption with an arbitrary password (that I will get through a dialog) in that code.
|
|
|
|
|
|
I found that article too. But the problems I described are not solved by this method.
1. The method encrypts a string and decrypts to a string. I don't have a string! (Or I would first have to encrypt all the strings before serializing! )
2. The key for Rijndael has to be of a fixed length (128, 192, or 256 bits), so I can't use a password of my choice.
|
|
|
|
|
Some encryption methods always give a fixed length (I'm thinking of PHP's MD5 function). You could maybe encrypt the password you choose using something like that and then use that to do the Rijndael thing.
There's quite a few examples of MD5 PHP style encryption if you google but (from experience) check them carefully as I've found with some they don't always work properly. I remember one I tried that didn't give a leading Hex zero for bytes less than 16 (decimal) so what should have been
0A0A0A0A0A0A0A0A came out as AAAAAAAA - not fixed length.
I haven't tried it but this[^] one looks ok.
|
|
|
|
|
As indicated by a previous user, all you need to do is intantiate the cryptostream class on top of your GZipStream, then use the resulting stream to read/write the serialized data. As far as the password goes, I would try to add some random characters (salt) to your passphrase, then take the SHA256 hash of that new string and use the hash as the key to create a new Rijandael cryptostream which would be used as previously stated. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|