|
|
Hello every one,
I have sql server 2005 express edition installed and I created the database using it.I then developed a C# application that connects to this database. Now I want to deploy all of this to a client PC (only 1 client).
does he need to have SQL server installed ?
What steps should I do to deploy ?
Thanks
All You Need Is A Good Friend
|
|
|
|
|
Perhaps this[^] will help
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I was wondering if anyone knows if there is a way of avoiding duplication of documentation when using virtual methods and polymorphy.
If we use virtual methods properly they are overridden to do something in a different way, not to do something else, in a logical sense. Hence, the doc for an override should be the same as for the method it overrides.
Is there any way to avoid having to copy the doc to all the base classes? Obviously the doc should be pretty stable in a perfect world, but then again the world is often imperfect and it's a pain to maintain consistency this way...
[edit]
Btw, I apologize if the C# forum isn't the approriate one for my question. XmlDoc is a C# feature, even if VB.NET and maybe other CLS-compliant languages provide something similar nowadays, so I didn't know where else it might go. Please say so if you feel there's another forum that would be more appropriate.
[/edit]
|
|
|
|
|
In situations like that, I typically use the include tag like so:
<include file="xmldoc_common.xml" path="//method[@class='BaseClassName' and name='VirtualMethodName']/*" />
and the file will look like:
<xmldoc>
<method class="BaseClassName" name="VirtualMethodName">
<summary>The method does such and so.</summary>
<returns>A value depending on what happened</returns>
<exception cref="ArgumentNullException"><paramref name="paramA" />
is null.</exception>
</method>
</xmldoc>
This lets you share as many or as few tags as you want. If you want to have separate remarks for each, just leave the remarks out of the common and put them on each derived class that needs them. If you need some common remarks and some class-specific remarks, well I haven't really worked that out. I think I tried it once and ended up with two remarks sections in the Sandcastle output.
Only the summary, returns, exception, etc must match what is in the normal XML comments, all other tag names are whatever you want.
The external xml file goes in the project (not solution) root.
|
|
|
|
|
|
I have a windows forms application made with C# Express edition 2008, connected with a MySQL database on internet.
The application in this combination is usualy lightning fast, but after a certain period of inactivity (say 30 minutes) the application takes forever (say 60 seconds) for it's first response. After the first response the application is snappy again.
As most of the times the application is used in response to a customer request (either by phone or in person) it's very annoying looking at each other for 60 before continuation.
The probable causes are:
- usualy the connections to the database are reused, which means they don't have to be created every time a database connection is needed. The theory is that after a certain amount of time the connection is destroyed anyway.
Question:
Is this a plausible explanation, and if so how can I keep the connection with the database (I open the connection for every request, and close it immediately after completion so I don't intend to keep the connection open, but just keep the connection).
Somebody else told me it could be Windows swapping the application to virtual memory (== harddisk) after inactivity.
Question:
Is this a probable explanation, and if so how can I test this theorie, and again what can I do to prevent this behaviour ?
Thanks for any hints and tips
Rob
|
|
|
|
|
PosiRob wrote: The application in this combination is usualy lightning fast, but after a certain period of inactivity (say 30 minutes) the application takes forever (say 60 seconds) for it's first response
60 seconds it way to much for database connection problem. What OS are you using? I Know that Vista and Win7 has properties in advanced power management for IDLE HDD. That option make HDD shut down if nothing was read or write on it after period of time. Before I Discovered this setting my HDD needed approximately 1 minute before I could start using it
|
|
|
|
|
Thanks for this answer, my clients run mostly on XP, but it's not impossible that XP also has these "features".
I have XP/Vista and Windows 7 so I can investigate this theory, thanks for thinking
Rob
PS, I marked question by accident as solved. Other suggestions are still welcome.
|
|
|
|
|
Hello. I Just checked about that options, and it exists in WinXP. Under Screen saver tab, there are settings for power options.
I do remember this on Vista, because it was set to default to 15 minutes. And i have about 4 internal HDDs. And every time I attempted to access HDD after 2 hours of inactivity I got a very big system LAG due to HDD powering on. However I don't remember it affected HDD with OS installed on it
|
|
|
|
|
The swap can be a problem. Try disabling virtual memory to see if this behavior changes.
The connection to the database being lost could also be a problem. You may want to execute some "keep-alive" command from 30 to 30 seconds to see if this stops happening.
Also, the HD being power off can be a problem. But, have you noticed this in other applications running in that computer?
|
|
|
|
|
Thanks for the suggestions. The client computers usually only run my application so I can't say if other applications face the same problem.
Excuse my ignorance, but do you have an example of a keep alive command ?
Thanks for your time.
Rob
|
|
|
|
|
PosiRob wrote: do you have an example of a keep alive command ?
Yes: SELECT 1
I think what he means by a "keep-alive command" is simply *any* command executed for the purpose of keeping the connection alive, not a special command.
Be aware that if you are using connection pooling, calling Close() does not actually close the connection to the database (it simply returns the connection to the pool). A whole minute to re-establish the connection sounds like a lot, but then I don't know anything about your environment or how you connect to the database.
|
|
|
|
|
Exactly. The keep alive command is only a command to be executed, that will not cause any data changes and is fast. It will only force the connection to be used.
|
|
|
|
|
Hi,
Is there any way to show "Press any key to Continue" message end of the run VS Console application.
|
|
|
|
|
yakupc wrote: Is there any way to show "Press any key to Continue" message end of the run VS Console application
Within Visual Studio if you start debugging with Ctrl-F5 it will do it automatically.
When you run your program outside this environment you will need to code it yourself (Console.Write and Read ).
|
|
|
|
|
By default, "Ctrl+F5" is mapped to "Start Without Debugging"
|
|
|
|
|
worked.It is great.Thank you so much.
|
|
|
|
|
Console.WriteLine("Press any key to Continue");
Console.ReadKey();
the second statement is optional.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
And a less user-friendly variant:
while (true)
{
Console.WriteLine("Continue to press any key.");
Console.ReadKey();
}
|
|
|
|
|
Alternate implementation. I actually think the other solution is better, but I was curious if this would work (and it does). Note that UseShellExecute is important, otherwise the process is opened in a new window. The disadvantage is that you're more tightly coupled with the OS (i.e. it wouldn't work under Mono on a non MS-platform)
using System.Diagnostics;
ProcessStartInfo psi = new ProcessStartInfo("cmd", "/c pause");
psi.UseShellExecute = false;
Process.Start(psi).WaitForExit();
|
|
|
|
|
Or run it from a BAT file.
myapp.exe
pause
|
|
|
|
|
@echo off
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I didn't want to confuse the reader with such details.
|
|
|
|
|
Hi All, I am facing a problem when I try to insert into sqlite database.
sql_cmd.CommandText = "INSERT INTO test('name')VALUES ('Value2')";
it is giving me error saying test table does not exist but in reality it does.
can you please tell me what I am doing wrong.
thanks in advance.
|
|
|
|