Re: Deployment of a C# Windows Application connected to SQL Server 2005 Database



(compjor@xxxxxxxxx) writes:
I am developing a windows application in Visual C# 2005 , connected to
an SQL Server 2005 database ,
I want to make deployment for the application so that the user can
have a copy of the application and the database and use it on his
machine even if they dont install the sql server

Eh? An SQL Server database without SQL Server installed is quite much
a useless piece of bytes.

i made it using Setup Projects. It was built successfully ,
and created Setup project, when i tested it on another machine ,it
displays the installation wizard ,but it displays an error when trying
to make connection to the database .. the error is:

An error has occurred while establishing a connection to a server ,
when connecting to SQL server 2005,....Could not open a connection to
sql server 2005..

You don't connect to the database. You connect to SQL Server which
will then access the database. But if there is no database to connect to?

also i logically feel that it is wrong to write an sqlconnection
statement with the name of my machine as the data source , and how to
copy SQL database to the user machine ?

There are two possible scenarios:

1) The user already has SQL Server installed on his machine, and don't
want another instance. In this case, give him the option to attach
the database to his server.

2) Bundle SQL Express with your setup, install SQL Express as part of your
setup and attach the database to it.

In both cases you would include the database file in your setup. (Actually,
I would rather use a backup, that the data files directly.)


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)