|
SledgeHammer01 wrote: Much better design.
Nonsense.
SledgeHammer01 wrote: so I usually provide an easy to use GUI for them
Which means you must STILL provide documentation. And a GUI.
So now you have increased the work and time to deliver.
SledgeHammer01 wrote: I know where you're going next... web.configs, web services, etc. don't have GUIs
So you create a GUI, and documentation for the GUI that handles multiple versions for a process that Operations/Support only uses once per install.
Thus quite a bit of additional time and cost - which is your rationalization for ignoring the fact that it rewrites the file?
SledgeHammer01 wrote: Entirely incorrect.
Something new for you to learn...
http://www.w3schools.com/schema/el_sequence.asp[^]
See the first example which says "which must contain the following five elements in order"
SledgeHammer01 wrote: which has some awesome performance optimization,
Yes the high volume tps servers that I have been delivering for the past 15 years do have measured and proven production performance abilities.
SledgeHammer01 wrote: The proper way to do ordering in an XML file is by using a key.
The proper way is to understand more about what "XML" means.
SledgeHammer01 wrote: What does this have to do with anything?
What it has to do with is documentation. Please read what I said. Trivial applications might have config values that are understood without documentation but more complex apps require substantial documentation so someone besides the original developer has any chance of understanding what the values mean, how they should be set, what the relationship between different values, etc.
SledgeHammer01 wrote: ...and having a non standard API, but thats just me.
Yes it is you, because I didn't say anything like that.
|
|
|
|
|
I don't know that the file should be stored in the user's documents directory, it doesn't sound like the right place.
I think a better place is APPDATA (APPDATA=C:\Users\Xxxxx\AppData\Roaming), then you can refer to it as @"%APPDATA%\dbs\latefee.sdf" and then use System.Environment.ExpandEnvironmentVariables before opening it.
It's olde school, like me.
|
|
|
|
|
Thank you all for dropping all this knowledge on me. It's been a while since I have done any coding, and I am not a programmer by trade. I am in IT for the company I work for, doing mostly tech work (very small business). I write small desktop apps for reporting from our POS system and use C# as I understood it most with VS 2003 (.net 1.1).
As I saw a need to update from XP to Win 7, I am trying to rewrite these programs with .net 4, so I am just now, as a few days ago, trying to learn the new IDE in VS 2010, the new classes and deprecated classes, etc, etc.
Thank you for your understanding and patience. Trying to google and study everything while taking calls all day for every problem from 'the internet is down' to 'this document is not printing correctly' is quite a task.
Again, thanks!
Jude
|
|
|
|
|
hi to all
i have a simple question please tell me,how can i close all methods by shortcut key and collapse all again.yes this is a basic question but i need it and i cant find this shortcut .thanks for help
|
|
|
|
|
Ctrl M, O
The shortcut is found in Edit->Outlining->Collapse to Definitions in the Visual Studio menu.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
|
Sounds like a Visual Studio question, not a C# question.
|
|
|
|
|
How to set the parent form size according to the child form in mdi forms
|
|
|
|
|
In the MDI container form, subscribe to the child form's SizeChanged event:
private void NewChildForm()
{
ChildForm child = new ChildForm();
child.MdiParent = this;
child.SizeChanged += new EventHandler(this.childForm_SizeChanged);
}
private void childForm_SizeChanged(object sender, EventArgs e)
{
Form child = sender as Form;
this.Size = new Size(child.Width, child.Height);
}
Something like that should get the job done. Just adjust the "new Size(int, int)" call accordingly.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
The "nice" way of doing so is by maximizing the child-form (WindowState wsMaximized)
|
|
|
|
|
Hi all,
i have a aspx grid with checkboxes for selecting the rows. I have some rows seleted and unselected rows also. how i can display only selected rows in the selectedindex_changed event of a dropdown
Thanks
Rk
|
|
|
|
|
Can't your restrict this resultset by controlling the data sent from database? In your select clause to fill this grid, only select the checked ones from the database to begin with?
|
|
|
|
|
Hi,
there is no status for the selected row in the database . this is an aspx grid. i need to hide the unselected rows
Thanks
Rk
|
|
|
|
|
If you don't need the unchecked rows in the datagrid, you can remove them from the datagrid's source as soon as they are unchecked.
|
|
|
|
|
Dear Group,
I am new to DirectX and I am stuck in one basic scenario. So my requirement is -
I am having C# Windows Form. Now on top of that form I have to Slide one Image on top of another Image. Both Images are passed to my this translating class.
I used the concept of Sprite after going through the online Samples. But the problem is when the Sprite is moving the background is set to the color which is provided in the Device.Clear() method. I didn't find any way by which I can overcome this. There is no way to set the background image of the Device too.
I also tried using the concept of Microsoft.DirectX.DirectDraw.Surface too. PFB the code which I tried -
// Code Snippet Begin
SurfaceDescription description = new SurfaceDescription();
description.SurfaceCaps.PrimarySurface = true;
description.SurfaceCaps.Flip = true;
description.SurfaceCaps.Complex = true;
description.BackBufferCount = 1;
m_PrimarySurface = new Surface(description, m_Device);
description.Clear();
description.SurfaceCaps.BackBuffer = true;
m_SecondarySurface = m_PrimarySurface.GetAttachedSurface(description.SurfaceCaps);
description.Clear();
description.SurfaceCaps.OffScreenPlain = true;
m_ImageSurfaceurface = new Surface("MyImage.jpg", description, m_Device);
// Code Snippet End
But here the line -
m_ImageSurfaceurface = new Surface("MyImage.jpg", description, m_Device);
is giving build error without any explanation why.
So I am in a stuck state. Please Help...
Note - I have DirectX 9.0 SDK installed.
Thanks in advance...
Shubhanshu .
|
|
|
|
|
When the receiving side of this serial port is idle, this sending method works just fine...
public static void SendCommandOutTheSerialPort()
{
int Length;
int StartingPosition;
byte[] TheBytesToSend;
Length = TheCommandToTheBox.Length;
StartingPosition = 0;
TheBytesToSend = TheCommandToTheBox;
myPortPool.myPort.Write(TheBytesToSend, StartingPosition, Length);
}
In fact, the Serial port can (and will, and does) send anything just fine.
The moment the external box starts sending us data, this method apparently stops and goes into an eternal loop on the last line.
Stopping the app in debug produces not a yellow arrow on the instruction (i.e., the last one in this method) but a green one instead.
Hovering over that green arrow produces this message..
"This is the next statement to execute when this thread returns from the current function"
I do not understand what thread the debugger has in mind, because I didn't start a thread. The only thing I can think of that even strikes the thought of the word "thread" in my mind is the background event handler that is doing the receive.
Just for good measure, I've set some breakpoints in the event handler that responds to bytes received on that same serial port, and it is properly receiving the bytes from the external box.
In fact, that's how we determined that conflict that was causing this. (We made the external box go silent; never sending any data, so this app can send without any response back.)
If it makes any difference, the send method and the receive method are in different classes.
Thanks for any light on the mystery.
|
|
|
|
|
You need to split your code so that the receiving part runs in a different thread than the sending part. Try a Google search for articles on serial handling for more information.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
If this means that a thread has been started, then this is news to me.
Who started the thread which I was unaware is executing ? How do I find this out ?
Thanks for any clues.
|
|
|
|
|
No it doesn't. As I said, you need to separate the code into two threads, one for sending and one for receiving. At the moment it would appear that your code is single threaded, so as soon as your receive event becomes active, the sending code is blocked.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Aha, now that is the answer I've been after ! Thank you.
This is not a problem in embedded systems which is where I'm accustomed to just going to the metal and flipping the registers. Gag, this is ridiculously complex.
Thank you for that explanation. It is the light I've been after. Thanks.
|
|
|
|
|
C-P-User-3 wrote: this is ridiculously complex. I guess it's more because of the architecture of the PC and OS.
C-P-User-3 wrote: It is the light I've been after. Thanks. You're welcome, I wish all questions were as easy to answer.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
C-P-User-3 wrote: I do not understand what thread the debugger has in mind, because I didn't start a thread.
Might help to keep in mind that ALL code on a modern desktop running with a standard OS executes in a real thread.
There are embedded systems that have threads and if so then all code executes in a thread as well although it might be some sort of default thread.
An embedded system without threads can be said to be executing, at least conceptually, in a thread as well. The single thread that runs the system. However that is stretching the definition.
|
|
|
|
|
Indeed, the mystery thread which I didn't start.
(Or so I thought; at one time)
I learned a thing or two at THIS[^] place, where that author provides this very useful insight...
"...The next part is critical and not obvious. serialPort1 runs in it own separate thread behind the scenes..."
(emphasis added by me).
This was really good and useful information, as you can see how it helped me to understand why I can't send and receive at the same time.
Request: I would like some kind soul to please point me to a few example code snippets that demonstrate how I can start a thread which will send out my byte array over the serial port when the existing background serial report receiver method/thread/whatever gives it an opportunity to do so.
|
|
|
|
|
Threaded my code to send a command while the other background event handler (which, as I think I'm learning, is also in a thread) is receiving.
Changed my external box to wait half a second between sending packets.
(Half a second is a long time in this context.)
He (my C# "myPort.Write(blahblahblah)" instruction) still won't execute.
I went even further. I got my external box to receive the first set of data which my C# app sends, but never send another pack back to it, i.e., the external box was purposely not responding, just sitting there so that my app on the PC would not receive data
When that happens, my C# app on the PC will transmit either the start or stop command okay, as often as it wants; i.e., with data received event, the sending works fine.
The moment I start receiving data, I can never send any more; not even one byte.
I used the C# IDE to stop the execution.
He is at this instruction...
Application.Run(new Form1());
There is a green curved arrow in the left hand edge of the window pointing to that instruction.
Hovering over that instruction gives me a message...
"This is the next statement to execute when this thread returns from the current function"
Who arbitrates those various threads ? How do I find out which thread is currently invoked ? Where is this behavior documented ?
How does a software writer get the background serial port received data event handler to back off and let the serial port send data ?
Is this documented anywhere ?
|
|
|
|