I have vs2010 click once winform program that performs the setup for another program. This setup program makes sure that they sql server is installed, creates the database/logins/tables, enables mixed mode, restarts the sql server(2008 express) then adds the stored procedures using the login and preloads some tables to get started. Works fine for winXP. When i do the setup on a Windows 7, it fails when it tries to restart the server.
I'm guessing it's a win 7 UAC 'feature' that prevents it, when I manually restart the server I get a UAC alert. I'm currently using the 'stopService' and 'startService' functions from http://www.csharp-examples.net/restart-windows-service/
Is there another way to do this in code without me having to install the SSMS to manually restart in Windows 7?
Have you tried running a prepared .bat file that restarts the sql instance via:
net stop mssqlserver
net start mssqlserver
Related
I want to debug a SQLCLR stored procedure in SQL Server. I have been trying to debug an SP in VS2015 Community and in the recently installed VS2017 Community editions without success. I am pretty sure that the problem lies in attaching to SQL Server but as I've done everything I can find mentioned online but to no avail.
When creating the database project in SQL Server Express LocalDB everything works fine. If I change the connection string to use my Developer Edition SQL Server, I then get an error. I have done the following:
I created a new database. I am the only user of the server and it resides on the same desktop machine that I am using for Visual Studio.
In Visual Studio I created a simple database project with a simple method to send some text to the output pipe.
[Microsoft.SqlServer.Server.SqlProcedure]
public static void mytest ()
{
SqlContext.Pipe.Send("in clr Craig1");
}
I edited the Target Connection String in the project properties to connect to the new database and successfully got a connection when pressing the connection button. The connection string used Windows Authentication for me, with the same user as the database owner.
I built and deployed the solution and checked the SQL Object Explorer to ensure that the SP was deployed. It was.
I selected the server and, using the right click, selected the "Allow SQL/CLR Debugging". I checked it again to ensure it was actually set.
I selected the stored procedure and with the right click, selected "Debug Procedure..."
The debug script was displayed. I stepped to the line to exec the SP and then pressed F11 to step in. At this point I was shown the following:
I pressed the attach and was shown the following error:
Thereafter, the procedure executes and performs the pipe function, but it does not let me do the attachment and the debugging.
Any ideas of what I'm doing wrong?
Thanks
Craig
You might just need to start Visual Studio with "Run as Administrator". I do not believe that I needed to do that when running Windows 8, but I am running Windows 10 now and definitely need to "Run as Administrator". I am guessing that you cannot otherwise attach to someone else's process (I have my Developer Edition running with a service account of "SQL Server", yet LocalDB always runs as the Login that started it, typically yourself). I have not tested to see if running Developer Edition as myself would still require "Run as Administrator", or how running Developer Edition as "Local System" would affect this behavior.
I am stuck while deploying my windows application (C#) in Visual Studio 2008. I am using setup wizard project to create the msi/exe file. This setup files I need to copy to the UAT server, run the setup and then use the application.
The main issue here is, I have created this application on my local machine and then installing it on UAT by taking remote of UAT server. This works properly. But when my colleague is running same application from his local machine by taking remote of UAT server, the application crashes.
Since the application working with my login, there seems to be no problem with the code.We are using our own windows login credentials for taking remote of UAT server.
Below is the error screenshot:
Please suggest what can be the possible reasons for the same application crashing with other user's id.
Thanks in advance.
0xe053534f is a StackOverflowException. You need to check if your setup script logic is resulting in any such stack overflow
I am using Visual Studio Express 2015 to build an application that reads a SQL Server CE database (I was reading a SQLite database but want to change, the sqlite program work fine). When I build on on machine it runs fine.
When I copy the binary and .sdf file to another machine (I have tried Vista and Windows 7, both 64 bit), the program hangs when starting. It never comes back. I can't even kill the process. I have to reboot.
I thought it must be something I am doing so I downloaded the source for CompactView and it does the same thing however if I install CompactView from the installer it runs fine.
Any ideas that would cause my program to hang and never return?
Also I am building for x86 and .net framework 4 client profile
The reason is that Avast was blocking the program from running. Once I disabled Avast it ran fine.
It could be permisions.windows vista & windows 7 have stricted permision policies.try in other folder
We have one Desktop application build with .NET3.5 in VS 2008. It is deployed on Network location which is accessible across the firm. Shortcut is created on user's machine to start the application. Desktop is being build (compiled) in AnyCPU configuration as Some user using XP machine and some are using Windows 7. Whenever new build (dlls and exe) deployed on network location, user have to close the app and restart it to work properly
Problem
We are facing a issue whenever we deploy new build (dlls and EXE) of the application. On Windows 7 machine application is not starting if we close the current running instance. User has to restart the machine itself to get it work.
Any help or suggestion is appreciated.
There is limited info to go on but the first thing I would make sure of, is the application still running under the Processes tab in the task Manager?
Go to the task manager on the computer and check the running processes tab to see if this app is still running.
It could be that it doesn't shut itself down properly after the user quits the application.
If the program is still running in the background then Windows will require a restart before the new dll's are loaded.
How to run exe file of C# Winforms app in other system or my client system?
In that Winforms application I have used SQL Server 2005 & C# for frontend ....
Now can anyone tell me, for that Winforms apps, remote connections is necessary or not? If yes then how to work on that, so I can easily run the exe file on other system also ?
I have done exe part but that file runs only on my system & that not runs on other system .
Just publish your .exe using Click Once and add all the required Prerequites.
About Sql Server you have to install that on your client system and attach your database.
Goto Project Properties
Click on Publish Tab
Press Prerequisites and select all you need for your application to run like .Net Framework...
Click on the Publish Now Button
If you are trying to access an SQL database from another machine you will need to make sure remote connections are enabled, firewall has the right exceptions in it and the connection string points to the servers full computer name/ip address.
EDIT
How to enable remote connections SQL server 2005
SQL server 2005 connection strings
Connect to database using sql server remotely