|
Would it be possible to pad the numeric portions with zeros? That should yield a more "accurate" sort.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
turbochimp wrote:
Would it be possible to pad the numeric portions with zeros?
Hello,
No! the given scenario was just to make the problem clearer. I have sort more complex values in the realtime application, something like "Buy Price 1.2034", "Sell Price 2.382", "Market Price" etc. It means that some values can be alphanumeric but others will be just strings.
Can anyone suggest a generic solution to this problem.
Bye
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
It sounds like you need normalization, not a different sort routine. In the example you offer, there should be 3 columns - BuyPrice (decimal), SellPrice (decimal) and MarketPrice (decimal).
If you're using a single column to hold three different pieces of data, you should think about changing the way the data is stored and/or displayed.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hello,
It is not the case of storing data in right way or something, it is just for the user friendliness, the way user wants to see it.
By the way, there should be only two columns, Price and Type . Any luck with the actual problem :s
Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
You can always display normalized data in a non-normalized way using SQL functions, string concatenation or by simple control placement. How you display data to the user should not dictate your data model. They seldom coincide.
In the example you provided, you would need three columns to hold price information unless you decided to either duplicate all row data for each price type, or move prices to a separate table. One price column in the same table would not cut it.
As far as "the actual problem", there isn't one. You're trying to use standard sort routines to sort data in a non-standard way; what's more, your data appears to be stored in a fashion that is not conducive to ever having meaningful reporting or display filtering options.
If you are completely devoted to storing your data in the manner you suggest, then I would advise investing some time learning how to implement the IComparable interface, and create your own collection class that's sortable. Please note that this option is less than optimal, to put it mildly.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hi all, i'm using System.IO.File to copy a shortcut to my application into the startup directory but on Windows 2000 machines the "Target" part of the shortcut is being renamed to my1~.exe instead of myshortcut.exe. This causes the applications process name to be changed to my1~.exe instead of myshortcut.exe which causes me problems in other applications. Anyone able to tell me how to either, change the target name back to what it should be after the file has been copied or prevent the name from being changed in the first place.
Cheers
Kev
|
|
|
|
|
Can any one let how to create toolbar in excel. I want to add new buttons to the toolbar and provide my own implementation when the user clicks the button
"The world's biggest power is the youth and beauty of a woman."
|
|
|
|
|
Go to Microsoft and look up the Office automation objects. I think that they should tell you everything that you need to know. You will likely need to get what are called the PIAs (I dont remember what they stand for now... something interop assemblies) which are essentially COM objects. With these you can pretty much interface with office directly.
I hope that this helped, email me if you need more help,
Jim
|
|
|
|
|
Hi!
I'm starting to create my own ebook reader as ms reader or mobipocket reader but I don't know how to start from the begin.
Please tell me some intruction, what elements I need, .....
Thanks for your help, I want to do it for convert all my documents to ebook!
|
|
|
|
|
Dinh Quan wrote:
what elements I need
I think the question you have to ask yourself is what elements do you want.
Write down a list of features that you want. Then write down everything you will need in order to create that feature. If there is anything in the list that you don't understand then find books or articles on the topic and read them. Design your application and then write the code for it.
If there is anything that you get stuck on when you are coding it then I'm sure we can help you better than we can now.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
Colin Angus Mackay wrote:
Write down a list of features that you want
I'm so amazing to get a fast reply, I guess my application is similar an documents reader as mobipocket.com, eReader.com. I have some ideas about my projects:
+ Can compile html, oeb (open ebook file), text, .doc file format( from the begin I think it support for text and html files first ) to a file can store and compress it to make a small size)
+ The reader can read my files and tranform (HTML) it as one or two page similar the way ms reader or ereader.com show ebook for everyone.
==> I think some items I need is:
+ HTML, XHTML, OEB Render -> read and tranform with small tag support
+ HTML, XHTML Pager <==this is very importan because it control the application speed.
+ How to compress my file read it from my reader
+ Compression and Decompression methor, I'm look for how to Decompression fastest and got a minimum of RAM resource.
I'm very thanks for all suggest, demo programes especial source code about it.
|
|
|
|
|
Is there any way to derive from one of the menu classes in order to modify the control in which the MenuItems are displayed (modify its Region, override its OnPaintBackground etc) in order to obtain a custom shaped menu ? Currently i have implemented one such menu by using a Form, but that got me into a lot of trouble and i have not even implemented the full functionality of a normal ContextMenu yet. The most obvious problem is the fact that the 'menu' Form needs focus in order to be able to receive any Click event, so the 'parent' window will lose its focus and be displayed with a 'grayed' title bar when the 'menu' becomes active (i fixed that by overriding the 'ON_NCACTIVATE message of the parent window, but i`m still unsatisfied with the result). Some suggestions will be most welcome. Thank you
|
|
|
|
|
hi
I am facing a problem.
i am having a ushort value (ushort val), and i want to campare it with two byte values(byte b1, b2).
how can i do it?
if I can convert the ushort to two seperate bytes or vice versa the problem can be solved.
i.e. the ushort which is made up of two bytes is to be decomposedinto two seperate bytes
thanking in anticipation
mahesh
|
|
|
|
|
Use simple mathematics:
byte x = 1;
byte y = 1;
ushort z = 257;
if (z == (x * 256 + y))
{
}
www.troschuetz.de
|
|
|
|
|
|
You could also try using the System.BitConverter class.
Kev
|
|
|
|
|
I need to write a console app that will allow me to get files out of SourceSafe. I can not make a reference to the type lib in the project. SO far all the samples with VSS use early binding. I have been able to get the late binding to work with Excel, but I am not getting very far with VSS. Anyone out there using Late Binding with VSS and C#? The reason I need to do late binding is I need to support version 5 and 6 of SS. If there is another way to ensure I can work with different versions of SS I am open to any suggestions.
|
|
|
|
|
how to upload a directory and save it to oracle database using C#
|
|
|
|
|
I'm not sure I understand what you're trying to do completely, but it sounds like you're saying you want to store a directory's worth of files in Oracle. Is that correct?
If so, it should be pretty straightforward. You'll want to iterate over the files in the folder (and possibly recurse over any subfolders), then for each file you encounter, read it into a stream, then write the stream to BLOB data in Oracle using a command and parameter(s). For reference, you may want to read up on the System.IO.FileStream class, the managed Oracle data client types, etc.
This is a high level answer because the question was equally non-specific. If you have more detailed questions, I'll be happy to try to help. I've done some of this in the past.
Things you may want to consider are:
1. Is file size a concern?
2. Do you care what the file extension is?
3. How do you want to identify files in the data record (name only, source path and name, etc)?
4. Are file permissions an issue when reading files or extracting them from the database?
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hi all,
Are there any third-party components for custom form designer for PC
(can be called by C#.NET), so the end users can create their own custom forms for data collection ?
Thanks
Patrick
|
|
|
|
|
I have created a simple Windows Froms app with about 20 or so controls. I would like to be able to store a snapshot of the control values in a preset file at any time, and recall the preset (again at any time during execution) in order to repopulate the controls. Rather than creating my own serializable class with member variables that correspond to each of the control values and manually getting and setting the control values during saving and recalling, it was suggested that I create a DataSet and bind the control values to the items in the DataSet. I managed to successfully create an xml schema and DataSet and add it to the designer so I could bind at design time, but have decided to bind manually in code (it turned out to be a pain to have to go back and re-bind every control in the designer as a result of making a change to the table and having to re-add the DataSet). In any case, the binding seems to work just fine when binding the Value property of my home-grown numeric edit control to an int or double field in a table of my DataSet, but I am not able to bind the Checked property of a radio button to a boolean field in the same table. In other words, this works…
this.ctrlStartTimeNumEdit.DataBindings.Add("Value", newDataSet1.ModelSettings, "StartTime");
This doesn’t…
this.ctrlFileCreationRBtn.DataBindings.Add("Checked", newDataSet1.ModelSettings, "FileCreation");
If it helps, I am creating my preset files using...
newDataSet1.WriteXml(filename);
and reading the preset file using...
newDataSet1.Clear();<br />
newDataSet1.ReadXml(filename);
I don't ever need more than one row of data (hence the call to Clear() before calling ReadXml()). I'm still not even convinced that the DataSet and data binding are worth the trouble for this application. At some point I will be using the values of most of the controls in function calls or equations and I still don't know the best way to programmatically get at the control values (from the individual controls themselves or the DataSet).
Thanks for your help - Any suggestions would be greatly appreciated.
|
|
|
|
|
Hi Newbie_T,
Hope this link will help you on binding Radiobutton control.
http://msdn.microsoft.com/msdnmag/issues/04/07/AdvancedBasics/default.aspx
Thanks
SGS
|
|
|
|
|
I already have this assembly that creates a proxy dynamically for my webservices..
the thing is, when you use WSE in a webservice as a webreference in VStudio.net, autmatically it creates two service names for every service name like this:
MyWebservice/MyService AND
MyWebservice/MyServiceWse <-- this one has methods such as service.RequestSoapContext.Security..whatever
then, when i create the proxy as new dynamic assembly it will only retreive the MyWebservice/MyService and it won't create the Wse ServiceName.. where does VStudio.Net retreives the Wse Service name from.. the proxy generator i have, uses System.Reflection to retreive webservice info such as webmethods, parameters and parameter types.. and yes, i actually added the Microsoft.Web.Services2.dll as a reference for dynamically compile the Proxys assemblies, and it wont bring the Wse service name either...
does ne1 know where do i get the MyServiceWse from??? Reflection doesn't seem to bring it up..
|
|
|
|
|
Hi everybody.
What is the C++.Net equivalent for C# base keyword?
Do I need to cast this to the base type?
Thanks,
Yaakov
|
|
|
|
|
this IS the base type (by default), and the contents of the base class are always visible, assuming they are visible at all ( not private ).
There are C++ and managed C++ forums, which may have been a better choice for this question. I assume C++.Net == MC++.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|