Click here to Skip to main content
15,898,729 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i finished my C#.net Application using visual studio 2010 and sql server 2008 r2 sp1(mdf databse),and i'm asking you what do i need to run it on another computer(client computer).
this is some code from my application.
C#
string cs = "Data Source=.\\SqlExpress; Integrated Security=True; AttachDbFilename=C:\\Dream Design\\Gestion De Caffée\\Coffee_Shop.mdf; User Instance=true;";

and on the app config file:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="Coffee_ShopEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=c:\Dream Design\Gestion De Caffée\Coffee_Shop.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>
Posted
Comments
Bernhard Hiller 26-Feb-14 3:29am    
C:\\Dream Design\\Gestion De Caffée\\Coffee_Shop.mdf is a terrible location for a file: better use e.g. %PROGRAMDATA%\\Dream Design\\Gestion De Caffée\\Coffee_Shop.mdf

You need compatible version of .NET Framework (which is freely re-distributed, you can distribute it with your software; via the installer or anyhow) and compatible SQL server.
I would advise to claim SQL as a prerequisite for your application, as then the user could use the license they might have.
And then, you need your application.

It is possible that your application depends on something else I am unaware of. You will need to check it by yourself.

—SA
 
Share this answer
 
1- Configure your sql server as here: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx[^]
2- Create a user for your db as here: http://www.youtube.com/watch?v=rbd1aOt8H94[^]
3- Set your connection string as here: https://www.connectionstrings.com/sql-server-2008/[^]
4- If you want, you can hide your connection string on client as here: Encryption Decryption Connection String for the App.Config File[^]

This makes your application to be ready for remote db connection. It is better to check other dependencies. But if you create a ClickOnce setup, it makes your job easier. Check out this: http://msdn.microsoft.com/en-us/library/bb546051%28v=vs.90%29.aspx[^]
 
Share this answer
 
v3
Comments
codeurx 25-Feb-14 16:52pm    
i mean if i take my application to the client computer what software should i install for him to run the database without problems with my configurations on my first post??
Vedat Ozan Oner 25-Feb-14 17:09pm    
what do you mean by 'client computer'? is it the client as in a software which connects remote computer (server), or your customer who buys your application?
codeurx 25-Feb-14 17:13pm    
i mean the customer who will buy my software
Vedat Ozan Oner 25-Feb-14 17:16pm    
then Sergey's answer contains what you need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900