Quick deployment of Visual Studio 2010 app with SQL database - visual-studio-2010

I am new to Visual Studio 2010, so please bear with me. Back in the days of using VB6 combined with an Access database, all I had to do was to use the Package & Deployment wizard and include the database file in the setup. Then all the client had to do was run one setup file and the application would magically run right away (the database would be placed in the App Path).
Is there some way to create a setup file in VS 2010 which will also install SQL Server Express automatically, attach the database along with the application itself?
This is meant for people who do not have SQL server installed and they should be able to start using the app by running one single setup.
Thanks!

Yes, your setup based on Windows Installer and built with Visual Studio itself can deploy everything you need. Read this article on MSDN for more details (maybe you won't need ClickOnce but it contains a lot of links).
I guess you need some clarification about your options (I assume you want to use a Microsoft solution because you talked about SQLExpress).
Microsoft SQL Server: fully featured database engine. It costs (a lot) and deployment isn't easy as we would.
Microsoft SQL Server Express: free edition (with some limits) of the big brother. Same installation issues. Perfect for medium desktop or web applications.
Microsoft LocalDB: single or multiple file, single user, support for stored procedures and advanced data types as in higher versions, easy to deploy and (optionally) per-user execution. Perfect for small/medium desktop applications and developing (with some preconditions with web applications too).
Microsoft SQL Server Compact 4.0: single file, single user, small, in-process, very easy to deploy. Perfect for small single user applications or used as local data storage (VS2k10 C++ Intellisense, for example, uses a SQLCE DB).
Microsoft JET Engine: the old beloved Access. If you come from VB6 I guess you know this.

If (and this is a big IF) your application is intended for a single user and you don't need data-sharing, now Microsoft provides a new version of SQLServer Express called LocalDB.
This version runs as standalone executable (isn't a service).
Its major advantage is the easy installation.
Search for LocalDB or look at my question LocalDB deployment

Related

Can't add Local Database to project

This might be a really dumb question... but in VS2013 when trying to add a local database to my Windows Forms Application Project the option is now shown in the C# items menu. The only DB that is available is a Service-Based DB. From what I understand, this is related to SQL Compact Edition but I do have SQL Server 2012 installed. Any ideas? Or are there any significant differences between the Local DB and Service-Based DB?
A service-based database is a database that is only accessed through a server. It uses an MDF data file, which is SQL Server format. To be able to connect to a SQL Server database the SQL Server service must be running, because it's that that processes your requests and access the data file.
A local database is one that is local to your application only. It uses an SDF data file, which is SQL Server CE (Compact Edition) format. There is no need to install a server to access an SDF database. You simply distribute the DLLs that constitute SSCE along with your app and access the data file directly.
You'd normally only use SSCE if the data was to be accessed by your app only and there was a relatively small amount of data. For your project you would use SQL Server. For testing purposes you can use the free Express Edition. When deployed you might still use SSEE or you might use a full version of SQL Server. Note that Microsoft include SSEE with their own RMS POS software. SSEE is limited to databases of 4GB though, so even if you start out with SSEE and it can handle the load, you may still have to upgrade at some point in the future based on data capacity.
Source of info:jmcilhinney post.
for help on creating the database have a look at this tutorial it may be of some help.
Hope this info helps you :)
It turns out VS2013 dropped the .sdf format.
Is Microsoft dropping support for SDF database files in Visual Studio?
The answer is yes: Microsoft is silently dropping support (as usual IMHO) to Sql Compact Edition.
It started abandoning Sql CE 3.5 in Vs2012 It continued dropping Sql CE in Sql Management Studio 2012 and finally in VS2013
You can use CompactView or install SQL Server Compact Toolbox extension in VS2013 or (my prefered solution) use Sql management Studio 2008
UPDATE thanks to Nicolas' comment
As stated by Microsoft:
SQL Server compact edition is in deprecation mode with no new releases planned near future. Last release SQL CE 4.0SP1 (and earlier releases that are still in the support cycle) will continue to be supported through its lifecycle and Microsoft is committed to fix any major, production blocking issues found in these releases.
Have you tried adding your local database from inside the project? Have a look and see if you can add your database from datasources.

How to integrate SQL Server 2008 R2 Reports on web site

I am creating a site that is mainly used to view reports. The database is SQL Server 2008 R2 Express with Reporting Services. I was thinking of using Business Intelligence Development Studion to create reports since it integrates well and is easy to use. The site does not exist yet as the reports are its main feature.
I started using Visual Web Developer 2010 for the site since I thought it would work well. A Microsoft rep recommended that I use Visual Studio 2012 since it's compatible with SQL Server 2008 R2 and is the latest version. HOWEVER, it seems that report integration was stopped since Visual Studio 2008.
What tools should I be using for my reports and site? The database must be Microsoft but I am flexible about everything else. I am looking for tools that work well with the database.
I also want to use source control software that is compatible/works well with whatever IDE/software I'm using. Any recommendations?
Right now, I am the sole developer. I want to be prepared to expand to a small team once the project is underway and I want to be set up right the first time!
If predefined reports is the main feature of your site, i recommend you to go a level higher and use some tool that let you create and design reports easily, like DBxtra.

Automatic installer for a web app on Windows 7 (or higher)

I have a web application implemented in ASP.NET MVC3 and SQL Server 2008 Express. It's relatively small so I can deploy it in local computer of my clients (Windows 7 or higher).
Currently, I deploy it manually by create new web site in IIS, copy published files to the folder of website, install SQL Server 2008R2 and use Management Studio to restore database with some initial data.
It's OK with me but not with my clients. They can't do the same things. What I want is an automatic installer, my clients just need to click a few buttons to get all done.
Specifically, this automatic installer must do the following things:
Install SQL Server 2008R2 Express and restore the initial database.
Install IIS7 (if it's not enabled in Windows 7).
Create a new app pool (V4) and a new Web Site use this pool. Then copy published files to the folder of the Web Site.
The installler can run aspnet_regiis command and grant permission for NETWORK SERVICE account to TEMP folder. This is required for web site to run.
The installer can copy some fonts to Font folder of Windows.
I see many app can do this automatic installer, but after googling I can't find a thorough solution to try.
Please give me some advice on this. Thanks in advance!
If you want a free solution, WiX is what you need, but it will take you some time to learn using it if you never created a package with it.
A more easy to use, and also powerful, but payed tool, is Advanced Installer, you need Professional edition, but you can try it for free with the 30 days trial mode. It has predefined prerequisite for SQL Server Express, built-in support to install IIS entities, and set file/folder permissions. Bassically all the requirements you need.
To enable any IIS feature you can simply add a PowerShell script.

Building webparts with Visual Studio 2010 Express

I'm trying to get started with building my own webparts, planning to follow this MSDN article.
I've downloaded Visual C# 2010 Express - I'm not quite at the point where I feel comfortable dropping 1000 big ones yet, and I installed Visual Web Developer 2010 Express via the WPInstaller.
Following through the tutorial, aside from the fact that I don't get the option to create a "Web Control Library", a gap I filled with this article, I can't seem to find the sn.exe tool (or the "Visual Studio 2005 Command Prompt"!).
I know it's not quite a direct programming related question, but I can't even get the thing going yet!
Any help is appreciated.
Thanks
EDIT:-
I think I may be jumping the gun quite considerably, I wrote a simple hello world example and tried to build it but it doesn't have any references to the Microsoft.SharePoint packages and they don't appear in my lists.
Am I understanding some more research I've done (namely this) correctly, in that I have to actually have a full installation of actual SharePoint on the machine I'm developing on?
sn.exe is part of the .Net Framework SDK tools - not actually part of Visual Studio.
If you've got the SDK installed (which I think you must have if you're using VS) then it will be in a directory such as (depending on which version of .NET SDK you've got installed)
c:\program files\microsoft.net\SDK\v2.0\Bin
You can develop SharePoint web parts with VS express but you won't be able to use extensions like VSeWSS which can make your life a little easier.
You don't have develop on a machine with SharePoint installed upon - you can just copy the Microsoft.SharePoint.dll assembly from a machine with it installed on and reference it in your project.
There are pros and cons to developing on a SharePoint machine.
Its easier to get started -
especially debugging locally rather
than remote debugging.
Harder to be
sure that you're code will work a
'real server' - are you sure you
don't have any dependencies that may
not be installed.
Harder to work with
multiple versions of SharePoint (2007
WSS and MOSS and 2010 foundation,
server etc).
If you do want to work with a locally installed SharePoint then
You can install windows server OS with SharePoint and Visual Studio.
there is a hack for installing SharePoint 2007 on vista (referenced in the SO article you link to)
you can install SharePoint Foundation 2010 on Windows 7 (but I am not sure what the licensing restrictions are - is this maybe something thats given through MSDN?)
If you decide to go with the remote server installation then save yourself some grief and use virtualization such as VMWare Server, Virtual PC or Hyper-V.
If you are doing SharePoint development trying to reference the Microsoft.SharePoint namespaces you need to have SharePoint installed on the machine if you want to do things like debugging, etc. For SP 2010 you CAN install SharePoint on a Win 7 machine. For previous versions of SharePoint, you will need to setup a Server that is Server 2003 or Server 2008 (you can't install SP 2007 and earlier on client machines). Generally this is a Virtual Machine for developers.
Having said all of that, there are relatively few reasons you need SharePoint to develop a WebPart. The vast majority of the WebPart functionality is part of the System.Web.UI.WebControls.WebParts namespace. Even if I am accessing SharePoint data, I generally use the ASP.NET web part.
If you are trying to use the new SharePoint VS 2010 functionality to create Visual Web Parts, etc, then you will need to install SP 2010, since that functionality is not supported in earlier version of SharePoint.
John

How can I create a setup file in visual basic 6 after completion of my programming work?

How can I create a setup file in visual basic 6 after completion of my programming work?
Front End language is Visual Basic 6,
Backend : MS Access 2003 and
Report Tools : Crystal Report 8.5. Operating System Windows XP.
You need to be a little clearer about some of this.
"Front end/back end" is really terminology and a thought pattern from the MS Access world. It doesn't really apply to VB6 development in any meaningful way unless you're doing something really odd like automating instances of MS Access.
That's about the only place where any "MS Access runtime" comes in as well. If you're actually using Access Reporting you might be doing this though - which seems odd but anything is possible.
See Deploying Complex Microsoft Office Access Runtime-Based Solutions.
Much more likely what you are trying to say is that you have a VB6 program that is using a Jet MDB as an embedded database, and using Crystal Reports 8.5 for reporting.
There should be no issue about any "runtime" for Jet on Windows XP, since Jet 4.0 is shipped as part of the OS even as far back as XP RTM (gold). It is also extremely unlikely that XP will have an MDAC release any older than 2.7 (see Microsoft Data Access Components (MDAC) release history).
So this leaves you looking for a way to package your VB6 program, any immediate dependencies such as possibly the VB6 runtime components, and the Crystal Reports 8.5 runtime components. You may also have INI files, etc. to bundle in there.
A long, long time ago (1998?) the PDWizard was replaced for most purposes by Visual Studio 6.0 Installer 1.0, and shortly after VSI 1.1 was released (1999?) which made up for a number of ills. This is a pretty basic tool for authoring Windows Installer packages, but it should meet your needs.
Along with this you'll want the recent merge modules for your dependencies: Merge Modules for Service Pack 6 for Visual Basic 6.0 and Visual C++ 6.0.
Then of course you need a merge module for Crystal Reports 8.5, and for this we have to turn to the community because BO didn't start releasing them until CR9. One place to look for this is InstallSite: Seagate Crystal Reports 8. Your real problem is that CR8.5 is ancient.
If this doesn't work out for you, you can always hope that CR8.5 Dev installed on your machine with a "good enough" set of .DEP files (which tell setup authoring tools what subdependencies each dependency has, among other things). This may still let you use VSI 1.1 to succesfully package your application with CR8.5.
You might also look at for-pay packaging tools as already suggested. If desperate enough you might look at some legacy installer technologies too, just in case their communities have addressed your issues.
If I misunderstood and you really do use your VB6 program to automate an instance of the "MS Access 2003 Runtime" you'll probably have to build some hybrid package.
But normal VB programs do not use Access or Access Runtimes to open and work with Jet databases.
You can search google for package and deployment vb6
and you will find millions of links showing in steps how to do that.
The Package & Deployment Wizard is quite primitive and not well-suited to distributing things like the MS Access runtime and Crystal Reports. You'd be better off using one of the more powerful commercial products like InstallShield or Setup Factory. However, these can be pricey (especially InstallShield).
There are also free products like Inno Setup and Nullsoft, but these may not be as easy to use or may lack some important features.
Bob's suggestion of using Visual Studio Installer 1.1 for a Visual Basic 6 application is sound but the Microsoft link he has given for the download does not work. I guess MS thinks nobody needs VB6 anymore. After searching a little I found a 2008 snapshot of MSDN page in web.archive.org complete with setup files:
http://web.archive.org/web/20080513102621/http://msdn.microsoft.com/en-us/vstudio/aa718352.aspx
Good suggestions above.
While it might seem unlikely that VB6 app could possibly be in use, there are those of us in the public sector that keep VB6-like apps and even Access apps alive because public dollars are not in a hurry to replace app that still work. A frequent mantra heard in many places is that you leave it alone if it is not broken. Broken enough that is--otherwise baling wire works just fine as long as VB/VBA developers can still found.

Resources