|
Pete O'Hanlon wrote: the fix-it fairy
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
That error means that the format of something that is trying to be converted to a number or date is wrong. Dates in particular are a pain because you really need to ask for input in an unambiguous format (e.g. 2011-10-07) which is unnatural, or allow a different format depending on the end user's locale. (Particularly for days like today where '7/10/11' is valid but different in the US or everywhere-else formats.)
|
|
|
|
|
angel 2 wrote: There's no error in the code.
How did you assume that?
angel 2 wrote: I get an error:"Input string was not in a correct format." Plz help me!
This error usually occurs during data type conversions, like when using Convert.ToInt() etc. You may want to check your string before converting.
|
|
|
|
|
angel 2 wrote: Re: Error!
That's an interesting subject.
angel 2 wrote: There's no error in the code
Lucky you. So why post a cry for help?
angel 2 wrote: Input string was not in a correct format
Most likely cause is the string you are converting to some type (int, DateTime, ...) is empty.
|
|
|
|
|
Hi,
I am a novice in C# and need to create a collapsible panel or expander in my C# project. I am using VS2010 .net4 Framework.
Please help with the code and explanation in detail.
Thanks,
Shikha
|
|
|
|
|
What type of application? ASP.NET, WPF, WinForms?
|
|
|
|
|
|
If your goal is to learn C#, learn to use GUI elements to create fluent interfaces, etc.: I suggest you spend some time trying to create your own "Outlook" style Panel Widget. A little struggle now, and then when you do go to examine someone else's code (like that in the excellent link that Ravi pointed you to in his reply), you'll be ready to absorb, primed to learn.
It's very simple to create such a control using Panels inside a "container" Panel: you can use the Dock property of the "inner Panels" to help you with adjusting the size of the "collapsed inner Panels."
good luck, Bill
"Use the word 'cybernetics,' Norbert, because nobody knows what it means. This will always put you at an advantage in arguments." Claude Shannon (Information Theory scientist): letter to Norbert Weiner of M.I.T., circa 1940
modified 8-Oct-11 16:18pm.
|
|
|
|
|
hi
I wanted to add Collapsible in windows form.
Thanks Ravi for the links.
Thanks for the suggestion Bill.
I am trying to make a project which require few functionalities which i need to understand. will keep posting you guys. Please do help.
|
|
|
|
|
please tell me how can i implement polyline in c# and which algo will be used???
|
|
|
|
|
|
Good one! 5+
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Hi guys,
I was looking around for a way to measure the time consumption of a certain algorithm in C#.
Here is what I came up with:
public static TimeSpan MeasureTime(Action action)
{
var startTime = DateTime.Now;
action();
var stopTime = DateTime.Now;
return stopTime - startTime;
}
I am wondering if there is a better code to do the job.
Best regards,
Omar Rwemi.
|
|
|
|
|
|
Thanks for the fast reply Dave. I will check Stopwatch Class.
Thanks.
|
|
|
|
|
Er... thanks also, I had not come across this before!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
You need to read up Marc Clifton's articles, he's covered this and other techniques for measuring performance.
|
|
|
|
|
I want to put little arrows inside a DataGrid to mimic the kind of display shown in this Excel file:
[IMG]http://i67.photobucket.com/albums/h292/Athono/arrows.png[/IMG]
But the XAML code defines individual columns instead of individual cells:
[code] <data:DataGridTemplateColumn Header="Prev. Mo. Trend" IsReadOnly="True">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<Image x:Name="img1" Width="11" Height="12" VerticalAlignment="Center" HorizontalAlignment="Left"
Source="/MedAnalyzer;component/Assets/greenuparrow.png" Visibility="Visible"/>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" x:Name="Prev_Mo_Trend" Text="{Binding Prev_Mo_Trend}">
</TextBlock>
</StackPanel>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>[/code]I can add text into the Datagrid by data binding with an observable collection. But this is text data. What about replacing gaphics? Do I need something extra special?
This is the results of my efforts
[IMG]http://i67.photobucket.com/albums/h292/Athono/otherarrows.png[/IMG]
I do not need to have the graphic and the text share the same sell. That part can be overlooked. How can I just replace the arrow with a different error within the cell?
|
|
|
|
|
Look, you have already been told that there is a Silverlight/WPF forum. Why don't you use it? That's the place for questions about Silverlight - not here.
|
|
|
|
|
|
Is there a way to find out if a query will return data before it is made?
I have an unusual problem. My code uses a 3rd party dll to make database calls from my silverlight client to a sql server database. In my code, I make dozens of calls one after the other. All of the calls execute successfully. But sometimes the result of a successful call is an empty dataset. Is there any way I can modify my call so that in the return will tell me what call was made that returned the empty dataset?
The 3rd party software pretty much retruns whatever command I give as a query I test in Microsoft Server Management Studio. Is there some sort of SQL command that will test if some sort of SELECT statement will return data and can that return statement contain the ID's or parameters used to make the statement?
|
|
|
|
|
First, the subject line is for a short description of your problem/question, not for the question itself. Please edit and shorten.
Xarzu wrote: Is there some sort of SQL command that will test if some sort of SELECT statement will return data
SELECT COUNT(*)...
Xarzu wrote: The 3rd party software pretty much returns whatever command I give as a query
Xarzu wrote: Is there any way I can modify my call so that in the return will tell me what call was made that returned the empty dataset?
You are passing the command to a method and you need that method to tell you what it was you passed to it?
No comment
|
|
|
|
|
SELECT COUNT(1) ... is more performant.
Even so, it will still perform the query, but won't return any data but the count. So, it will only be "faster" because it doesn't have to gather-up the data to send back over the wire. The resulting data still has to be produced in order to count it.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Xarzu wrote: Is there a way to find out if a query will return data before it is made?
Nope. Doing a COUNT will execute the query and count the results.
Xarzu wrote: I have an unusual problem. My code uses a 3rd party dll to make database calls from my silverlight client to a sql server database.
Why? What does it add/why is it required?
Xarzu wrote: In my code, I make dozens of calls one after the other. All of the calls execute successfully. But sometimes the result of a successful call is an empty dataset. Is there any way I can modify my call so that in the return will tell me what call was made that returned the empty dataset?
The method that makes the call usually also returns the dataset. Where are you "receiving" your datasets? Over an event ?
Xarzu wrote: The 3rd party software pretty much retruns whatever command I give as a query I test in Microsoft Server Management Studio. Is there some sort of SQL command that will test if some sort of SELECT statement will return data and can that return statement contain the ID's or parameters used to make the statement?
Nope. If you want to diagnose your Sql as it is executed (with the parameters) then you'd use a Profiler[^].
Bastard Programmer from Hell
|
|
|
|
|
Hi All,
I have a routine that calls a C++/CLI DLL from C# in order to generate an image. After the generation, I have (in the DLL) a pointer to 'unsigned short' array and the image dimensions. Now I'd like to somehow use this pointer to display the image in a C# form (using PictureBox ot ony other suitable component), but I have no idea how...
Thanks for the help,
Eyal.
|
|
|
|