|
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.
|
|
|
|
|
|
Set HideSelection to false. When the TreeView does not have the focus, the selected node will be displayed in a light gray shade. If you want to change that, you need to have an owner drawn TreeView.
|
|
|
|
|
Yes, I have set HideSelection to false, but the gray color is too white, it's hard to see.
Is there a sample to show how to redrawn the Treeview? Or is there a easier way to resove it?
|
|
|
|
|
Just google "Owner draw TreeView in .NET"
|
|
|
|
|
I´m developing a Windows Forms app with C# 2003. Well, I´ve got a DataGrid control with 2 Date columns with "dd/MM/yyyy" format...the trouble is that when I click that columns' headers they get obviously sorted by day, then month, and then year (01-02...30,31)...and I want them to get sorted by year, then month and then day...I´ve placed this code on the datagrid_mouseup event...so when the datagrid sorts the column it will do it correctly...but I don´t know how to revert back the date format, because the sorting method seems to be internal and performed after all other DataGrid´s events are processed. So how could I know when DataGrid has finished sorting to put the dates into their former format? (or other way of doing it, of course). Thanx.
<pre>
DataGrid.HitTestInfo hitTestInfo = myDataGrid2.HitTest(myDataGrid2.PointToClient(Control.MousePosition));
if (hitTestInfo.Type==DataGrid.HitTestType.ColumnHeader)
{
if ((hitTestInfo.Column==2)||(hitTestInfo.Column==3))
{
for (int i=0;i<Avisos.Rows.Count;i++)
{
DateTime myDateTime = DateTime.ParseExact(myDataGrid2[i,hitTestInfo.Column].ToString(),"dd/MM/yyyy",null);
myDataGrid2[i,hitTestInfo.Column] = myDateTime.ToString("yyyy/MM/dd");
Application.DoEvents();
}
}
}
</pre>
modified on Thursday, November 26, 2009 6:32 AM
|
|
|
|