This method does not return anything if the if-case is never true. This leads to 'not every possible scenario' is returning a string as expected. Add a return statement after 'for' ends to correct it. If nothing else, return an empty string.
Error 2 Cannot implicitly convert type 'int' to 'bool'
Your checking condition in for loop here:
for (j = 0; i = s.Length - 1; i--, j++) //Incorrect
SQL Server should be installed seperately by the user, if at all. Your application installer should ask the user for the SQL Server connection details, like servername, IP address, port, instance name, username and password to use to install/attach your database.
If the user already has SQL Server installed, they can use that, as well as putting the database on a seperate machine from the one your app is installed on.
By putting the SQL Server installation inside your own setup, you are limiting the choices the user has to install your app.
I have a program for synchronizing my computers time from the time on the Internet, but since I updated my program to Windows7 it no longer works. If I run the program by right clicking on it and running it as an Administrator it will run and change the time on my computer. Otherwise, the program runs and it does not change the time.
How do I run this program in C# as an administrator, any help will be greatly appreciated.
This is by design to make it harder for program to make suspicious changes to the system. You can modify the manifest to indicate that the application should always be run as an admnistrator (or modify the link). That way, you will have one less step to do as a regular start will start the application with administrative right. You still have to confirm that you want your application to have that priviledge.
Depending on the application, it might make more sense to check the time and only if a change is required then prompt the user. This will typically be done by using 2 exécutable files. That approch would be the one an application with auto-update would typically use.
It would be my guess (and suggestion if it works) that you could and should create a Windows service that starts automatically, logged in as say System, and stays alive as long as Windows does. Then you would never interact with it nor been bothered by it or any UAC dialog.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012