|
I am not the only one using this application and probably you didn't understand my question.
|
|
|
|
|
|
Try using:
var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
I think that does what you want. Take a look at the Environment.SpecialFolder enumeration, it has some other useful folders in there as well.
Hope this helps.
|
|
|
|
|
Thank you. That was the code I was looking for. But there is a minor problem, at Windows XP it crashes the application, in Vista and 7 it works fine.
|
|
|
|
|
Strange. Do you get an exception? If so, which one?
Have you tried stepping through, seeing what is going on just before the crash?
|
|
|
|
|
The application I tested this code is in is a simple console application which I've created just for testing purposes. It contains two lines. This and Console.ReadLine(). It throws an exception but framework is not able to catch it so it is shown as a standart Windows exception. When I check it's details I can only see that it occured in System.Security namespace.
It's quite odd.
|
|
|
|
|
It might be a permissions problem
Make sure you're running it from a folder local to the PC and with an administrator account.
Try surrounding the code with a try/catch and echoing out the exception to the console, or sticking a breakpoint in the catch block. It might get something Visual Studio might not catch.
|
|
|
|
|
Hi Everyone,
Iam struck with sending a decimal parameter to a stored procedure. Can anyone help us in this regard
cm.Parameters.Add("@test", SqlDbType.Decimal);
Regards,
Manowj
|
|
|
|
|
What error are you getting?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi,
I am getting the below error when i passed
cm.Parameters.Add("@Qty", SqlDbType.Decimal);
Failed to convert parameter value from a String to a Decimal.
Regards,
Manowj
|
|
|
|
|
Check the value you are passing in @Qty. Are you passing a correct decimal value?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
No string should be involved; how are you setting the Value of the parameter?
I would use cm.Parameters.AddWithValue("@Qty", datetimepicker.Value )
Don't make a value into a string and then parse it back to the type is was.
|
|
|
|
|
Edit: It seems I was incorect with this statemnt.
|
|
|
|
|
|
Hi,
Can You please Tell me what is the difference between 'byte' and 'Byte' as a datatype in C#
thank you.
|
|
|
|
|
No difference really, just different names for the same thing.
'byte' is just short for System.Byte. It's a primitive so has shortened form.
Regards,
Rob Philpott.
|
|
|
|
|
|
|
Byte is NOT a wrapper for byte.
'byte' is a C# keyword that is a synonym for 'System.Byte'.
In computing, the word 'Wrapper' has a different meaning.
|
|
|
|
|
You are confusing with java. in C#
byte == Byte
string == String
...
...
..
..
|
|
|
|
|
None. One's a synonym for the other.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
The only difference is when defining an enumerated type; byte and the other aliases are allowed, but System.Byte etc. are not.
|
|
|
|
|
you know, select a tree node, it would be highlighted with blue color, if the tree lose focus, the color would be gray, it's hard to know which one is selected, is there a good way to change the gray to a light color? Or need to redraw the node?
if need to redraw the node, there would be many works need to do, like restore the node etc.
Is there a good sample to show this?
Thanks you!
|
|
|
|
|
Did you change the color of the TreeNode.
Also dont forget to call TreeView.Invalidate() method to force tree view to repaint.
|
|
|
|
|