Is there any possible way to create a setup in for my program written in vb.net using sql server as the backend.I have a module which creates the database code and i have also created a setup in vb.net for my project but i want this setup to run properly even in a system which doesnt have visual studio and sql server installed.I tried running it on a system which doesnt have both but the error i get is sql server 2005 doesn't allow remote connections in default settings,i tried changing some settings but nothing seems to work.Is it necessary for a server to be there for creating the database?
-
Hmmm, why not try using a non-server solution like SQLite? – TheZ Sep 28 '12 at 17:55
-
does sql lite work with the same commands as server..sorry but i don know much about sql lite commands and i have written quite a lot of code for creating database in sql server i don want to change my code again :( – mayur patki Sep 29 '12 at 04:48
3 Answers
a little Google always does the trick...
To configure SQL Server 2005 to allow remote connections, you must complete these steps:
1.) Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
2.)Turn on the SQL Server Browser service.
3.) Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.

- 9,420
- 12
- 57
- 96
-
@peterG:thanks for the answer but i tried including sql server express in the pre requisite and it gives the same error "Remote connections not allowed"...i didnt understand this line can u elaborate please "You can then amend the package.xml file at C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages" – mayur patki Sep 29 '12 at 04:41
-
@user1532208:- thanks a ton probably this is what i should look into and should i execute that command line similar in the way i execute my sql code??? – mayur patki Sep 29 '12 at 04:45
-
:-thanks scott but i have tried this and its quite a lengthy process and i dont want my user of the software to have this burden of changing the settings.Is there anyway that i can accomplish this writing a program ....can u guide me further – mayur patki Sep 29 '12 at 04:46
-
@user1532208,scott,peterG,theZ:- i want my software to work on xp,vista,windows 7 and 8 what is my best option of sql component ...which sql server version should i use which suits all the OS or is there any other software which i can use?? thank you all for your help – mayur patki Sep 29 '12 at 04:50
When I write programs that require SQL Server to be installed on the client, I use the following logic :
If it is not installed, I prompt the user to download it (or download it for them using your installer script. I use NSIS installer). Make sure to install the appropriate version for the user based on your requirements (and the client's operating system). I typically use SQL Sever 2008 R2 Express Edition, SP1.
I then execute the SQL installer using my installer script command. In NSIS, it's ExecWait. In VB.Net you have something like this. You'll have to install it via command line parameters. Here are the list of command line parameters: http://msdn.microsoft.com/en-us/library/ms144259(v=sql.100).aspx
Here's what I use:
C:\PathToMySQLDownload\SQLEXPR.exe /QUIETSIMPLE /SkipRules=RebootRequiredCheck
/ACTION=install /IACCEPTSQLSERVERLICENSETERMS=1 /FEATURES=SQL
/INSTANCENAME=MSSQLSERVER /SECURITYMODE=SQL /SAPWD=MySAPassword /NPENABLED=1
/TCPENABLED=1 /SQLSVCACCOUNT="NETWORK SERVICE" /SQLSYSADMINACCOUNTS="NETWORK SERVICE"
/AGTSVCACCOUNT="NETWORK SERVICE" /ASSVCACCOUNT="NETWORK SERVICE"
/RSSVCACCOUNT="NETWORK SERVICE" /ISSVCAccount="NETWORK SERVICE"
/ASSYSADMINACCOUNTS="NETWORK SERVICE

- 1
- 1

- 305
- 1
- 4
- 13
You can include SQL Server Express in the Pre-requisites for your setup project.
When you build the setup project, it will pick up the packages that are required for the installation from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
You can then amend the package.xml file for SQL Express to change how it is configured by the installation. Look for the Command Arguments element, and then to switch on Mixed mode authentication add SECURITYMODE=SQL to enable remote access add DISABLENETWORKPROTOCOLS=0
(or for SQL 2008 r2 it's /tcpenabled=1 )
When the end user runs the isntallation, SQL Express will be installed first, with the options you have specified.

- 1,651
- 3
- 14
- 23