2

I have a winform app being installed by ClickOnce and I need to be able to enable Remote Connections in sqlexpress by default.

Also, I need to make sure the local user has access to the SQL instance. How do I edit the manifest file?

My app is a part of a Merge Replication topology. I inherited the DAL and until I change it I cannot switch to SQL CE due to SProc's limitation's.

SQL Express is ClickOnce (able) and is a default in VS2008 as a prerequisite.

Below is the Product.xml of the SQL Express Bootstrapper package. How can I modify this to accomplish what I need? Has anyone else had to modify this? Here is an example of this.

<Command PackageFile="sqlexpr32.exe" Arguments="-q /norebootchk /qn reboot=ReallySuppress addlocal=all instancename=SQLEXPRESS SQLAUTOSTART=1 ADDUSERASADMIN=1" EstimatedInstalledBytes="225000000" EstimatedInstallSeconds="420">
<InstallConditions>
 <BypassIf Property="SQLExpressInstalled" Compare="ValueEqualTo" Value="0"/>
 <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="5.1"/>
 <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
 <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatformXP"/>
 <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatformXP"/>
 <FailIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" String="InvalidPlatformArchitecture"/>
 </InstallConditions>
<ExitCodes>
 <ExitCode Value="0" Result="Success"/>
 <ExitCode Value="1641" Result="SuccessReboot"/>
 <ExitCode Value="3010" Result="SuccessReboot"/>
 <ExitCode Value="50037" Result="Fail" String="MissingMSXml"/>
 <ExitCode Value="50251" Result="Fail" String="MissingMSXml"/>
 <ExitCode Value="50198" Result="Fail" String="InsufficientHardware"/>
 <ExitCode Value="50236" Result="Fail" String="InsufficientHardware"/>
 <ExitCode Value="50222" Result="Fail" String="InvalidPlatformOSServicePacks"/>
 <ExitCode Value="70003" Result="Fail" String="InvalidPlatformOSServicePacks"/>
 <ExitCode Value="50247" Result="Fail" String="InvalidPlatformIE"/>
 <ExitCode Value="50248" Result="Fail" String="InvalidPlatformIE"/>
 <ExitCode Value="70004" Result="Fail" String="AnotherInstanceRunning"/>
 <ExitCode Value="70032" Result="Fail" String="BetaComponentsFailure"/>
 <ExitCode Value="70033" Result="Fail" String="InvalidPlatformArchitecture"/>
 <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure"/>
 </ExitCodes>
 </Command>

I thank everyone for there time.

Refracted Paladin
  • 12,096
  • 33
  • 123
  • 233

3 Answers3

1

SQL Express Edition is still a server class database. It runs all the time as a service, and like any server-class database likes to a lot of resources. It's just not really a good choice for local desktop app.

If you need a single user database use something like SQL Server Compact Edition, Sqlite, or even Access. I doubt you'd appreciate it if you installed a desktop app only to find it dragged a full sql server install along with it.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • Thank you for taking time to post. SQL CE is, unfortunately, not an option at this point as it does not support SProcs. I have it planned to remove our DAL layer and replace it with LINQ but I have not got that far. – Refracted Paladin Jun 04 '09 at 21:27
0

If your package.xml is not playing ball and you want a far simpler solution for desktops firebird may be an option for you there is a PDF on convertion from sql server, stored procedures can stay, that way. If I converted all my sprocs to Linq I would go mad, let alone the testing... When converting be aware of e.g. crystal reports or other 3rd party utils that read data off your server. proof on concept work needed. But having deployed and now see it failing on even fresh setups of W7 I agree with the sentiments here. Local DB is not looking good for us either as our peripheral utils are hard coded .\ and it needs (localdb)\

0

SQL Server is a service. It seems it is theoretically possible to install a service with click once, see here and here.

I suspect that installing SQL Express by click once is impossible because it is a technology for deploying sandboxed applications. SQL server runs close to the metal and wouldn't likely work in a sandbox.

SQL Compact is another story and is a more appropriate way to deploy a click once app with its database.

Or let the app reference the database on another server.

EDIT: And if I've gotten your question all wrong (and this is a click once app on a client workstation that already has SQL Express), you'll need to enable remote connections this way. There are scraps of evidence that the SAC tool can be used to do it programmatically.

Community
  • 1
  • 1
MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
  • 1
    thank you for taking the time to post. SQL Express is not only possible to deploy in Clickonce but is one of the Default bootstrappers available in VS2008. I am in a Merge Replication Topology so I cannot use "another server" and SQL Compact doesn't support SProcs and until I have a chance to rewrite tho DAL as a LINQ library I am forced down this path. – Refracted Paladin Jun 04 '09 at 21:24
  • By install SQL do you really mean indicate that it is a pre-req? Well, there is this page: http://msdn.microsoft.com/en-us/library/bb264562.aspx#emsqlexcustapp_topic4 It says you can tell the click once app that SQL Express is a prerequisite but it still seems that the SQL Express install part will require admin rights--very unclick once-ish. If you are right, then I can install SQL Server on my locked down corporate workstation, which will be totally awesome. I will try it. – MatthewMartin Jun 04 '09 at 21:50
  • yup, that is what I am doing. Indicating that it is prereq for my app. It installs just fine, though are users are Admins of there own systems. – Refracted Paladin Jun 04 '09 at 21:59