How to export the .NET project having connected with database? - c#

I have completed my .net project using visual studio 2012. How can I export my project so that I can run it on other pc too. The problem is that the database is not working on others pc bt perfectly working on my lappy. Why is it so and how can I solve this problem?? Please anybody help me out....

Get this situation at work fairly regularly as we have multiple instances of SQL Server and MySQL (Not so many of these) and deploying then testing the program can be quite laborious and any change in the deployment means you have to go back to the original, change and re-deploy.
What I would do is install visual studio express, or visual studio 2012 shell on the local machine where the deployment is going to take place and debug there. If it is a corporate environment where licensing is an issue, installing visual studio express will mean that you do NOT have to purchase a license and therefore not incur cost.
The other situation is that you connect from your local machine to the MySql database but you'll have to open firewall ports which could get messy and, testing the program will not give you accurate performance results as your accessing a database over a network thats not configured for it.
There are other options such as using an attached database but again, gets messy with you changing the structure of your program.
My advice is go with the visual studio express solution...

Related

Visual Studio 2015 version 3 freezes on editing Roles in Azure project

I'll preface this with the fact that I'm very new to Visual Studio, so I am prepared to hear that my problem lies in something I haven't read yet.
I have a database first project in Visual Studio 2015 v.3 that I am attempting to publish to an existing Azure account and resource group.
I have successfully converted it to an Azure project via the menu options: Build > Publish to Microsoft Azure.
I can successfully build both the local and the Azure projects without error, but whenever I attempt to edit the Roles in the Azure project to add the Azure connection string as per the tutorial found here, the program hangs up irretrievably. This makes my twelfth attempt to edit the Roles.
It took Visual Studio five tries to publish to Microsoft Azure using the menu options above.
To fix this, I have tried all of the following:
Restarting my computer
Restarting my Azure connection
Restarting Visual Studio
Confirming Visual Studio's connection to the Azure account I want to publish to
Checking to be sure my Azure SDK (version 2.9.1) and Visual Studio (version 3) installations are the most recent versions and that the installation appears to be clean
Removing the Azure portion of the project, cleaning and rebuilding the local solution, and reattempting to publish to Azure
Cleaning and building both solutions before attempting to edit the Roles for the Azure portion of the solution
Confirming that the resource group I am attempting to publish to does exist at the specified connection string and contains the necessary resources (in this case, a server and an SQL database)
I am attempting to connect (for now) with HTTP and not HTTPS, as per other similar questions about Visual Studio 2015 freezing while publishing to Azure
Confirming that I am able to connect remotely to Azure via Visual Studio (this is probably a gimmie, but it doesn't hurt to be specific)
I also notice that when I attempt to browse the Azure features on the menu to the left of the Visual Studio window, Visual Studio freezes (particularly if I click on the links for Data Factory, Mobile Services, Service Bus, and Virtual Machine).
Server Explorer is showing that I am logged in to Azure with the account I'm attempting to publish to.
I can reach, read, and edit the local database files. I can also run the local project without error.
The application was configured to use an IIS Web Server and uses SQL Express. It froze repeatedly while attempting to change configurations from the IIS Express and LocalDB default to IIS Web and SQL Express.
I do have the application backed up locally as well as via a private GitHub repo just in case I manage to bork it permanently trying to do this.
I would very much appreciate the help.
edited to add: I'm currently running Windows 10.
edited again to add: The task manager shows the load to memory and CPU during the period when Visual Studio is frozen to be less than 15%, the majority of which is not Visual Studio. It shouldn't be a hardware issue, but I did try closing the majority of the background services that were non-essential just in case there was some sort of conflict occurring.
Making this an answer instead of a comment because while it may be a silly oversight, there's bound to be someone who would benefit from the answer.
The problem was that I was working from a local copy of a remote database. When it came time to push up to the remote, I deleted the local copy and data interface model, and reconstituted the model on the remote database, creating several connection strings in Web.config.
When I attempted from there to publish, Visual Studio read the connection strings in the Web.config for the project and attempted to hunt down the local and over-write the remote database.
Removing all other connection strings from the Web.config for the project removed many of the problems with freezing and hanging that I was experiencing (and made the project run faster by resolving the search for associated project resources.)
Lesson learned: make sure you clean your Web.config file before attempting to push to remote.

Customize Update Rules for Visual Studio Applications

We're trying to publish updates of a C# visual studio Application onto a remote server.
With well over a few hundred systems connected to a few servers, we want to keep a list of either client computer names, or client computer local IP addresses and include or exclude them from a specific publish version.
The question is, can we modify a publish configuration, other than the given tools(read, wizard) from Visual Studio, which is very limited in its configuration?
P.S. visual studio 2012 premium
Use an instance of ApplicationDeployment.CurrentDeployment to write yourself an updater that fixes your needs.
Wrote a more detailed explanation.. but couldn't post it because of a 9hour edit block, so sorry, I guess.

Running a project's Setup, created in VS 2012 on other PC's

i developed a project in visual studio 12 using C# and sql server 2012, i exported my project and a setup file was created. how can that setup run on any other computer? I mean that what are requirements for a PC to be able to run my setup On it. Specifically related to databases as my project is dependent on database retrivals (Insert,Delete,Modify).
Thanks.
in any computer that have a near configuration to yours or better !
if it's a small programme it can work in any computer running under windows xp or any other newest version (it can cause design problems ""at least with Xp"" -_- )
and for database the computer where u'll install this programme must have sql ! if it doesn't u need to add sql express to your setup ! or work with Access or similar .. !
i hope this was helpfull ^^

Want to create c# .net installer

I have a .net application in c#. I am using SQL Server 2005 as database. I want to create setup for it. I want that when I run setup it automatically installs SQL Server 2005 which I add in prerequisites.
Please help how to create setup...?
The paid versions of Visual Studio come with the ability to create installer packages, however, that feature is miserably lacking and is being removed in VS11. I have used it, and I can say, its not worth using. There are other free deployment tools out there. I recommend Windows Installer XML.
VisualStudio does have New project -> Other project types -> Setup and Deployment -> Setup Project. As Kendall noted this is a very limited/basic installer solution. However if really all you want to do is have SQL Express as a prerequiste and you app installed then it can manage that (but not much more).
To setup a prerequist:
Go to project properties (right click on setup project -> properties)
and you will find a "Prerequisites" button on that dialog.
This brings up a dialog that lists all the bootstrapper packages that are
located in "Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper"
folder. Select/cehck "SQL Server 2005 Express Edition SP2 x86" if
thats what you want.
If you want the full version of SQL server then you will need to find a bootstrapper package for it - googing that (sql 2005 full bootstrapper package) should yeild a result.
Note that SQL server 2005 will limit you to an x86 install - if you want a x64 install use SQL Server 2008 Express/full.
You could create a Setup project in Visual Studio.
It can create an offline setup, which can include prerrequesites or be configured to download said prerrequesites from an online location when installing the offline setup.
http://msdn.microsoft.com/en-us/library/2kt85ked.aspx
Before going into this, though I would like to share my very bitter experience using SQL Server as a prerrequesite, and why you should really avoid it (whichever deployment system you use, actually).
See, the prerrequesites that are available to your Visual Studio instance depend on a folder present on the same machine where VS is installed:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
(this is for VS 2010, replace v7.0A with v6.0A for VS 2008, and replace Program Files with Program Files 9x86) if you're on 64 bits).
You can go check it now, you will most likely see a list of folders, called bootstrapper packages, which have this basic structure:
product.xml : an xml file describing the prerrequesite to Visual Studio. This file is the most important one. It lists:
the files that are needed to install, upgrade or uninstall a prerrequesite
the conditions to evaluate in order to decide which action to undertake. For instance: is the system x86/x64? is the system xp, server 2003, etc? is the prerrequesite already installed? which version? which language?
the actions to undertake depending on these conditions. Generally, the command line arguments to use with the exe file you are installing.
a bunch of executable files (msi, exe): the files needed to install the prerrequesite (there can be none if the product.xml refers to online locations where to get these files).
optionnaly, some folders with a locale name: the localization for your prerrequesite.
Now there are two major categories of issues with this system:
drawbacks of this setup system:
First, the product.xml file is very difficult to build. It will most likely imply you to calculate checksums, create certificates, explore Windows Installer install log files, use a very buggy tool called the Bootstrapper Manifest Generator. You will find yourself googling problems, and the only result will be your own unanswered Stack Overflow question. Trust me, I've been there.
Second, this whole boostrapper thing is litteraly out of (source) control, and an insult to the concepts of team work and continuous integration. Having your project install configuration in Program Files means:
it has to be the same prerrequesites for all your projects.
no versioning.
you must keep the whole prerrequesite folder consistent across all machines that could build the solution, including the CI server (which can be a massive hussle if it is used by several teams).
drawbacks of SQL Server as a prerrequesite:
At first sight, the SQL Server install command line seems quite straightforward. You decide the name of the instance, if it's an install or an upgrade, access rights, etc. The thing is, I cannot count the number of issues you will encounter on your path when you actually try that in real life:
SQL Server won't upgrade from a language to a different language.
SQL Server won't upgrade from SQL Server x86 to SQL Server x64 on an x64 system.
SQL Server not en-US won't install on en-US Windows.
More generally SQL Server will most likely fail to install if anything close to SQL Server has already been installed on the same machine.
If you run the setup manually, it will tell you why. But if you try to do it as prerrequesite, it means that you have to foresee every single configuration issue that could possibly happen. Believe me, you will never see the end of it: there's a reason why the SQL Server Setup is so complex...
Now what could you do?
Ask your clients to have SQL Server installed. It is a decent option, and they have to manage the SQL Server license anyway, since they are the ones using it. Maybe they already have it.
Install it yourself.
Use a different version of SQL Server, like SQL CE. Very lightweight, some less functionalities but if your just want a local database it can do the trick.
Use a different RDB system. I don't know them, maybe they are easier to install.

Including a stand-alone copy of a Database inside Published VS2010 C# Project

I have designed a small C# Windows Forms project in VS2010 & now want to Publish it and test it on another PC. I seem to recall seeing an option when I was first setting the Database up, that if I set that option on, a complete stand-alone copy of the SQL Server database would be included in the published project, so that even a PC without SQL Server of any kind installed, would be able to run the program ... but I can't remember where I saw it or, obviously now, how to choose that option !!!
Can somebody please tell me where I saw this and how to set this option on ?
UPDATE ...
OK, I think I've found out what to do here, as when I installed it onto the other PC it automatically downloaded and installed SQL Server 2008, I changed options in the Solution Explorer Properties / Publish / Prerequisites ...
If you have simple needs for a local DB you could use SQLServer Compact Edition. SQL CE runs in process within your app.

Categories

Resources