|
Hi,
i face a problem to create a setup of window application in vs2010.
for create a setup i use vs window installer and done step by step as i seen many examples in Google( how to create setup for window application).
But in my case shortcut create in desktop, but when i click on the shortcut it will running look like as it install project again.
same uninstall project create in all programs but when i click on them nothing happens.
please help me.
Thanks.
|
|
|
|
|
Create shortcut of executable by right click on it in Application Folder in “File System” Section of Setup Project. And then cut the shortcut of file and paste it into user desktop folder and build the project.
It should work.
|
|
|
|
|
Hello All,
I was wanting to start a discussion about best practice when creating threads in a Windows Service.
I have a service that has multiple process running at the same time (6-10). Is it better to use timers or threads? I personally prefer threads because I can end them all with a single line of code where as if have to end each timer individually. Plus with threads, you don't have to worry about it calling it self until you want it to.
Does anybody have any other thoughts on this? What's a better way to go and why? Which is lighter on PC usage and memory? etc etc
Thanks in advance,
Bryan
|
|
|
|
|
BBatts wrote: Is it better to use timers or threads?
When the timer fires it uses a thread.
BBatts wrote: Plus with threads, you don't have to worry about it calling it self until you
want it to.
Huh? If the thread is running and not blocked then it is fact running. If you weren't saying that I am not sure what you are saying because the execution flow is always in one thread or another.
BBatts wrote: because I can end them all with a single line of code
Not sure what that means exactly. At least sometimes one can't just end threads arbitrarily and sometimes one must end them in a certain order. But the same applies to timers but only to the extent that they too are using threads.
|
|
|
|
|
"When the timer fires it uses a thread."
Yes. To be more specific a timer is an object the fires a thread periodically.
"Huh? If the thread is running and not blocked then it is fact running"
If the thread your timer has fired takes longer to execute than the interval level of a timer it will fire again. Unless, of course, you disable it. Where as if one is using a System.Thread there is more direct control over when and how the thread is fired.
I can't think of any reason to use a Timer as opposed to System.Thread...in a windows service. I guess that was the point of my post.
|
|
|
|
|
BBatts wrote: System.Thread there is more direct control over when and how the thread is
fired.
How exactly do you "fire" a thread in the above?
How exactly do you think that process is different than what a timer does?
BBatts wrote: I can't think of any reason to use a Timer as opposed to System.Thread...in a
windows service
Because one wants an action to occur based on something associated with time. For example running a process every hour or once a day.
|
|
|
|
|
You are not comparing like with like: timers have one purpose, threads another.
Use the best guess
|
|
|
|
|
Quote: I have a service that has multiple process running at the same time (6-10)
is it multiple thread or process..??and what are you trying to achieve with timer or thread..?
can you please be bit more specific..
vikas da
|
|
|
|
|
Yes. It performs varies disk related services. Clean Up, Archive, Backup, etc etc. There can be up to 6 process running at the same time.
I currently create and fire 6 System.Threads on the Start() event. Each thread has a loop that keeps it running with a Thread.Delay, so they look something like this:
private void WorkerThread_DoWork()
{
while (contiueWorking)
{
System.Threading.Thread.Sleep(10000);
}
}
The task may or may not take longer than 10 seconds to complete, depending on the amount of data that is being managed. So, my question is (and admittedly I'm stumbling trying to ask it) would it be better to have 6 timers in this situation or should I stick with the threads? Or am I simply overthinking it.
|
|
|
|
|
I'd be using Timers for this purpose. As it's by far easier to control the execution of the timer instead of a thread.
I generally use the System.Threading.Timer with the following callback pattern:
Initialize it like that:
System.Threading.Timer _timer;
_timer = new System.Threading.Timer(OnTimer, null, 10000, System.Threading.Timeout.Infinite);
And this callback method
private void OnTimer(object state) {
try {
} catch (Exception ex) {
} finally {
_timer.Change(10000, System.Threading.Timeout.Infinite);
}
}
To stop the timer just call:
_timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
If you use it like that it should never ever be called concurrently as after the first event the timer is disabled until you manually reenable it (i.e. in the finally clause)
Greetings
|
|
|
|
|
Thanks Nicholas, I've never seen it done that way!
|
|
|
|
|
|
Please post your question in the forum at the end of that article, so the author can help you.
Use the best guess
|
|
|
|
|
What code do you currently have in place for creating the menus? How do your menu items relate to the database? Given that you've said that it should only be displayed when a user is logged in, you could easily just hide the menu items that the user shouldn't see by using the Visible property on the menu item.
|
|
|
|
|
Thank you! It's Worked! 
|
|
|
|
|
hi ,
How to use this for sql server 2008
SQLiteDatabase db = this.getReadableDatabase();
ICursor mcursor = db.rawQuery(selectQuery, null);
i wanna get ICursor from Sql Server 2008 in C# (somthing like Sqlite)
cause i wanna use that in monodroid.
|
|
|
|
|
ICursor isn't an interface that's supported in SQL Server. What you have here is SqlLite specific code. In order to do something similar with SQL Server, you would want to create a SqlCommand object, associate it with a SqlConnection (you use this to Open the connection to the database) and then use ExecuteReader to get the equivalent behaviour. However, I doubt that you will be able to do this for MonoDroid as you would be required to install SQL Server drivers on the Droid device. Sorry.
|
|
|
|
|
thanks for reply.
I can use sql code without any problem.
just i wanna get ICursor.
is it possible to get ICursor even with Linq ?
|
|
|
|
|
As my reply indicated - ICursor is for SqlLite. It isn't for SQL Server. If you want to use the SQL Server functionality, you have to use the types that are supported.
|
|
|
|
|
what about DataTable Or .... ? ( give me advice )
can get ICursor from that? I should some how get ICursor any way ?
thanks in advanced!
|
|
|
|
|
Which bit of you can't do you not understand? Do you really not get that this is a SQLLite object?
|
|
|
|
|
|
What is your fixation with ICursor, what are you actually trying to do. I can't help thinking you are asking the wrong question, what do you want to use ICursor for?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hello everybody i need some help to get the same in the following link (c# code and class and dynamically and based on stored procedure database)
check the link
the link
thanks for all
|
|
|
|
|
Help with what?? You haven't asked a question yet.
|
|
|
|