This gets the value in the first row under the SmtpServerColumn (you can also use the name or 0-based index, although using the DataColumn instance will be faster).
I suggest you read the documentation for the DataSet class and related documentation. If you're not familiar with this stuff, simply guessing won't teach you anything. Reading the documentation will help, and may be present you with some alternatives in order to do things more efficiently and with less development time.
Well, you don't have to instantiate a struct, correct? So you should be able to just get away with this:
MyStruct structs = new MyStruct;
Remember that structs are value structures, so to change values on structs in your array, access the array by index each time unless you pass one by index into a method using the ref keyword. It'd be simplest to just access values the same way:
Besides double-buffering, another problem could be that you're waiting to extract the bitmap from the assembly as an embedded resources until the event fires. This will take some time.
Either pre-extract and buffer the image before the event is fired (like buffering the next and previous images if you're not sure which will be next to display), or don't dispose of the image in the PictureBox until the other bitmap is ready.
Double-buffering will help the situation where you replace the bitmap in the PictureBox, however. Instead of disposing the current image and reading the next image in (so there's some "dead time" in between), the new image is drawn to an off-screen, compatible bitmap and displayed only once it has been rendered to this compatible bitmap. It can then be swapped with the on-screen bitmap fast enough that you shouldn't notice (large images may still flicker a little, however). .NET makes this pretty easy by setting the AllPaintingInWmPaint, DoubleBuffer, and UserPaintControlStyles enum members using the protected SetStyle method (which requires that you'd extend the PictureBox control.
What I want is working in the client with my custom class instead of working with the class that the proxy generates. Then, I want to pass directly the custom objects to the web service.
To get that, I must first use a fully XML serializable class, so I must have a wrapping class that uses my custom object as a public attribute.
The question is how to implement the wrapper as simple as possible. I saw an example but with too clases: the main class, an implementation of CollectionBase for the main class, a third class that uses the collection as a parameter, and the fourth that gives functionality to the third class.
I have a project that contains several classes. Class1 has a public variable, let's say var2, of type Class2. Class2 has a public variable, x, of type ArrayList.
Finally, in x I load objects of another class, Class3, which has a public property named Myprop.
I cannot access MyProp from Class1.
(like this: var2.x[index].Myprop). Why? What am I doing wrong?
I think I have to announce somehow that in x I load Class3 objects (my x is declared like this: public ArrayList x=new ArrayList())... I don't know.
I try to avoid Killing processes unless it's a last resort.
To quote MSDN: "Data edited by the process or resources allocated to the process can be lost if you call Kill. Kill causes an abnormal process termination and should be used only when necessary."
The task manager opens handles to the performance counters amongst other things. Just Killing it may not release them cleanly. Latter versions of Windows are better at handling reclaiming such resources, but I feel it's better to play nice.
There's always Process.CloseMainWindow. The idea is to avoid P/Invoking when possible since it can help lead to more portable code. It was an example and I would hope that for most code samples I post they just don't take them as-is - the ol' copy and paste. I try to teach people, not hand them the answers so they can continue their pursuit in ignorance. You may a good point, though.
Yes, and I believe that TaskMan.exe is a well-formed Windows app.
Process.CloseMainWindow (MSDN) "in a well-formed application, closes child windows and revokes all running message loops for the application. The request to exit the process by calling CloseMainWindow does not force the application to quit...The behavior of CloseMainWindow is identical to that of a user closing an application's main window using the system menu. Therefore, the request to exit the process by closing the main window does not force the application to quit immediately."
Can somebody tell me how to Unregister a Service Process so that its name is not displayed in the TaskManager Process List. I required the solution for Windows XP platform. For Win9x platform, we can do it with RegisterServiceProcess API supported by Kernel32.dll. But the same thing is not working with WindowsXP since kernel32.dll doesnot support this API or It does not have this entry point.