|
No, actually you called your DataSet "Table1", which I noticed in your previous post. Your DataTable is named "Table". The DataSet element is the root node of your DataSet , the child nodes is/are the DataTable (s), and their children are the fields in a row of the table.
So, dsDiff.Tables["Table"].NewRow(); would work, but you really should name your DataSet and DataTable appropriately according to your needs.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
This is driving me crazy. I have a double variable that has taken a value very close to zero. I try to put the value on the console as
double noiseMean;
Console.WriteLine(noiseMean);
It displays the value in the scientific notation. How can I tell it to display it as the decimal notation. I tried using noiseMean.ToString(), but it always frmats it in the same notation.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
|
Hi,
Thanks for the reply. However, it still throws out the variable in the scientific notation.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi,
You pointed me in the right direction though. Just saw the section on format specifiers. "d" is for integral datatypes only. Using "f15", basically fixed point with 15 as the precision specifier did the trick.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
The format specifier "d" or "D" will always throw a FormatException for certain primatives like double .
Instead, use Console.WriteLine("{0:f}", 0.0000000001d); , for example. This defaults to two decimal places. If you want more, specify the precision after "f", like so:
Console.WriteLine("{0:f8}", 0.0000000001d); The result here will be the same, of course: 0. You can change the precision how you see fit, though.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Woops, you got me on that one. I blame it on only having Visual Studio 6.0 in front of me as I typed my response, err, if you want to call that an excuse.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi there,
I'm only a newbie in C# and I have some problems with screen resolution.
I can't find a way to resize my forms (and controls within them) when I change screen resolutions. I'm coding on a system with 1280x1024 resolution and, when I execute the program on my notebook, that's 1024x768, forms stretch and controls often "change position" and move beyond form border.
How can I solve this problem building resolution-independent forms? Do you know some FREE controls that resize automatically my forms (i.e. XSizer -> shareware) or how to code a simple control that does this job?
Thanks.;)
Max
|
|
|
|
|
The actual resolution isn't as much of a big deal as the DPI (dot per inch, sometimes called PPI, or pixels per inch). As far as the size of the forms, you can use the Anchor and Dock properties of any Control (though some may override it or choose to ignore them).If you anchor a control to opposing edges, it will always be resized so that the original margin between the sides of the control and it's container (the sides that were anchored) is maintained. If you don't want that, don't anchor opposing sides. You can also use anchoring to move controls, like an OK button that should always be in the lower-right corner.
Docking works in a similar fashion, but keeps the control docked to a single edge or all four edges.
As far as the DPI changing, that's a different matter. Since pixels are logical units and Windows Forms uses pixels, your layout can't be gauranteed under a different DPI. VB6 got around this by using twips, which is a physical unit and should always look the same on any display.
Laptops these days are typically using 120 DPI while desktops are still using 96 DPI (though many flat panel users are using 120 DPI as well).
You can handle the Microsoft.Win32.SystemEvents.DisplaySettingsChanged event to get notification when either the resolution, color depth, DPI, or any other display setting changes. You can also write a transformation class as I've shown in a previous discussion about this a few days ago: http://www.codeproject.com/script/comments/forums.asp?msg=829941&forumid=1649&Page=3&userid=46969&mode=all#xx829941xx[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you man...
I'll try with Dock and Anchor properties...finally I can start to code a "real" program.
Thank you again!
Bye.
Max
|
|
|
|
|
I am writing a small custom win form control (i.e. UserControl). I would like to pop up a wizard the first time the user places the control on a windows form. I cannot figure out how to tell the first time a control is places??? I cannot seem to find any methods or properties in the designer class. Can anyone help here? Thanks!
|
|
|
|
|
Implement a ControlDesigner for your class and attribute your UserControl with the DesignerAttribute specifying the Type or type string for the designer class. In your implementation of Initialize or OnSetComponentDefaults , you could pop up a wizard dialog or whatever you want.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Does anyone know what is equivelent of "strstr" in VC# ? Thanks.
|
|
|
|
|
See String.IndexOf and related methods in the .NET Framework SDK documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You can use the IndexOf method of the string class, of course it does not return a pointer like strstr does.
|
|
|
|
|
|
Background:
I'm trying to write a media player that supports various file and playlist types, cd ripping, format conversion, etc. Pretty standard "media player" stuff really.
The first task is to enable playback.
Issues:
I've downloaded the DirectX SDK Summer 2003 update, and audio/video playback is supported by using C#. This rather simple playback however, and not what I'm looking for. I also noticed that DirectShow cannot be used directly by C#, and I have looked at several code snippets using Interop. Allthough Interop will give me the results I'm looking for, the approach to get those results using Interop ar not to my liking.
Possible solutions:
- Anyone know if there will be "managed directshow" for C#? I noticed in the DirectX SDK that they write "This is preliminary documentation and is subject to change." on almost every topic I searched on.
- Learn C++. This would be a solution that I know would work, I would like to use C# though.
- Create C++ backend dll's for the complex work and C# for interface etc... This is just a thought, I haven't found any articles actually building applications this way.
Last words:
Right now, the media player is a bunch of notes on a paper, and I would really like your thoughts/ideas/input on multimedia in C#.
-thorbeck
"Computers are stupid,
they can only give you answers."
picasso
|
|
|
|
|
|
First off, thanks for the link.
That site had some other interesting source codes aswell.
I'm aware of using "winmm.dll" through Interop, but this will bring me to a halt when further development on the media player is to be continued.
I feel the lack of complete control when using Interop and try to avoid it whenever possible, allthough it seems that for the moment I have to stick with it unless I crawl into the unexplored world of C++.
For the moment, C++ has the power to do what I want.
I.e. auto gain, dsp, equalizer, crossfading, 5.1 output, etc..
I spend alot of time learning C#, and enjoy coding, but I don't have the time to learn yet another language.
To give you an idea of what I want to write take a look at http://foobar2000.org/[^].
And if I ever get this huge rock rolling, it will be open source...
-thorbeck
"Computers are stupid,
they can only give you answers."
picasso
|
|
|
|
|
That site had some other interesting source codes aswell.
Yeah, they sure do.
I'm aware of using "winmm.dll" through Interop, but this will bring me to a halt when further development on the media player is to be continued.
I feel the lack of complete control when using Interop and try to avoid it whenever possible, allthough it seems that for the moment I have to stick with it unless I crawl into the unexplored world of C++.
Yes, I dislike using Interlop as well, but there isn't much I can do about it.
For the moment, C++ has the power to do what I want.
I.e. auto gain, dsp, equalizer, crossfading, 5.1 output, etc..
This is true. Maybe you should try to look for a componet written in C++ that already does this.
I spend alot of time learning C#, and enjoy coding, but I don't have the time to learn yet another language.
Same here unfortunately.
To give you an idea of what I want to write take a look at http://foobar2000.org/[^].
Interesting.
And if I ever get this huge rock rolling, it will be open source...
Sweet. I am trying to make a media player as well. Only with mine, I am not going for the features of a standard media player, but a "weighted random" player. (i.e., if rating is ten play most often, if rating is one play almost never. Just think radio station... Play the best songs often, bad songs rarely) I would be happy to work with you on creating the media player.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
Sweet. I am trying to make a media player as well. Only with mine, I am not going for the features of a standard media player, but a "weighted random" player. (i.e., if rating is ten play most often, if rating is one play almost never. Just think radio station... Play the best songs often, bad songs rarely) I would be happy to work with you on creating the media player
weird, i wanted to make one like that too. did you get something done yet?
is it available for download.
i read once an article in dr. dobbs journal and it had nice algorithm for figuring out "best songs".
|
|
|
|
|
weird, i wanted to make one like that too. did you get something done yet?
Yes, I am working on it. It works (sorta), but there are a lot of bugs, and it doesn't have a playlist editor, so you just have to edit the playlist by hand (nasty business), and it doesn't read XML yet
is it available for download.
Not yet, but I'll post it on CP when I finish it.
i read once an article in dr. dobbs journal and it had nice algorithm for figuring out "best songs".
Interesting, but I made my own algorithm. The general principal for mine, is to use a bellcurve to chose which song rating should be played, then randomly chose from the songs with that rating.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
If you thought that the Managed DirectX is REALLY "managed" you are terribly mistaken. It is nothing more then an MUCH improved wrapper for the Direct X unmanaged code. But still it is not too far off from a standard Interop assembly automatically generated by tlbimp. So I don't think that you will be hurting your design much by using Interop DirectShow.
|
|
|
|
|
Then I have been terribly mistaken, but thanks for being a light in a very dark tunnel...
At least now I know where I stand, and if I notice performance issues I might look more into C++.
-thorbeck
"Computers are stupid,
they can only give you answers."
picasso
|
|
|
|
|
I'm using a float to keep track of a scale factor -- sounds easy enough. When the user clicks a button I either add or subtract 0.10F from the scale value (it starts at 1.0F). After several iterations I start to see the value varing by a small amount i.e instead of 0.80 I get .7999. This seems like a large error for a simple addition or subtraction operation... Any insights?
|
|
|
|
|