|
hi,
i m having a integer array which i need to sort frequently
example code:
int[] intarray = new intarray[5];
in between the code
array.sort(intarray);
now this code runs fine sometime and sometime it fails
error is
Failed to compare two elements in the array.
pla if anyone is having any idea abt this then plz do let me know
regards sindhu tiwari
its me sid
modified on Friday, January 04, 2008 3:26:44 AM
|
|
|
|
|
Array.Sort() fails for vanilla integer arrays? While it's possible, I think it's highly unlikely.
Have you googled for the exact exception message? I doubt if you've given the exact message, and Google returns no results.
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
this is the error which i got "Failed to compare two elements in the array."
and searched on google too but unfortunately dint got proper result if u any way to sort or any idea then plz do let me now
sindhu tiwari
its me sid
|
|
|
|
|
Well, could you show us what values you've put in the array then?
|
|
|
|
|
ya sure
intarray[0]=1;
intarray[1]=2;
intarray[2]=null;
intarray[3]=3;
intarray[4]=null;
i hope this will help you ..thanks for response
regards
sindhu tiwari
its me sid
|
|
|
|
|
It certainly does. You can't sort an array of ints if they have nulls in them. Convert intarray into a nullable int instead, i.e. make it int? . Mind you, I don't see how you could have got this code past the compiler because an ordinary int can't contain a null value so the system should have choked on it.
|
|
|
|
|
would u plz tell me how to make it a nullable int array.........
regards
sindhu tiwari
its me sid
|
|
|
|
|
I already did. Add the question mark (?) after the int. So you would have
int?[] intarray = new int?[5];
|
|
|
|
|
Hi,
I am developing a windows application. In this I have a list box which should be populated with a list of categories in the form load event.I've used a DataReader to do this. when I add a new category it should be automatically added to the list box also.I should use a seperate form to add a new category.If it's a Web appl it's very easy as the page will be refereshed every time.
|
|
|
|
|
I need to create such type of application through which i increase and decrease the volume of the system.
and mute and mute the sound from the application.
both master volume and wave volume handles.
|
|
|
|
|
|
Hello,
I am trying to cnvert a WORD file into a PDF in C#.NET. For that I am using GhostScript. It folows two steps.
1) Conversion of WORD TO PS
2) Conversion of PS TO PDF.
I can get the PS Fromat, but then I have to manually double click on PS File to get the PDF format. How do I get it automatically?
Help needed...
Thanks in advance
Vruddhi
|
|
|
|
|
I have made a small software which requires .Net framework 2.0 and Sql server Express.I want to make a setup file which automatically installs these two components.
How can i achieve this??
|
|
|
|
|
Make a setup project in your same application then
Right Click on your setup project and go to properties
by doing this a new window opens, on that window there is a button
with the name of prerequisites click on it
and it will solve your problem
|
|
|
|
|
|
Someone told me that the method needs memory ,is this true? In this way,does the static method can share their memories?
Thanks!
|
|
|
|
|
|
Uhh, every method needs memory to execute.
Having said that, a static method does not need memory to be allocated for an object (aka instance) to be executed; as opposed to a non-static method.
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
Is it possible to throw an exception in any of the drag/drop events? Whenever I try to throw one (on purpose) code execution returns at the point of the exception, but no exception dialog appears and my application doesn't halt.
Is something interceding on my behalf because throwing an exception in any of these events is a bad move, or is this a bug of some sort?
VS2008 Pro/C#3.0/.Net 3.5/Vista x64.
PS Dragging stuff from a different domain (Outlook) on to my app.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Hi all,
I have two datatables.
dt1 has the columns: nr, name, address, tel, mobile, fax
dt2 has the columns: name, address, mobile
How can i make from those two datatable one datatable? i have to set the result later in a datagrid.
thanx.
|
|
|
|
|
Just make a third table that has the columns of the other two in it. You can pull the column names out of the two tables and insert them into the third. Populate the third with the data and bind the third table to the datagrid. It's easy, just involves a couple steps.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Paul, thanx for your response.
how do i populate the third datatable with the data of dt1 and dt2???
can u write some code pls?
|
|
|
|
|
|
Giorgi,
Thanx a lot, it realy helped
|
|
|
|
|
You are welcome
|
|
|
|