Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i created project using c# (vs 2010) with sql database

i used this code to connect to database :

C#
public static string jeptus_Coonn = "Server=.\\SQLExpress;AttachDbFilename="+@"D:\JEP\JEP CoronaSalesdb\jep_corsalesdb.mdf"+";Database=jep_corsalesdb; Trusted_Connection=Yes";


what the sql version which i need to install it on user computer to run the project ?
i need full version ?
Posted

You should not install SQL Server - that should be up to your user. There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea to try and select the right options for them!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.
 
Share this answer
 
Comments
Wendelius 12-Jul-15 5:40am    
Funny, somewhat similar answers at the same time :)
Not sure if I understand you correctly, but...

The application that accesses the database needs a client library in order to communicate with the database. In your case this would be .Net framework since it contains System.Data.SqlClient[^] namespace which provides the db connectivity.

The database side on the other hand is built by installing SQL Server (Express in your case) on some computer and by configuring it properly so that the client has proper user information, privileges and network access to communicate with the DB.

In many situations the database server and the client application resides on different locations. This way multiple clients can access one, centralized database. Of course depending on the application the application and the database may also be on the same computer.

What comes to the version to use. Based on your connection string you've used Express edition which is free to use. Other versions require licensing except compact edition which can be embedded to your application. However, compact edition can't be used by multiple client.
 
Share this answer
 
Comments
Golden Basim 12-Jul-15 5:53am    
if i installed Express edition on the user pc , the project will work ?
Wendelius 12-Jul-15 6:05am    
That's quite impossible to say without knowing the whole situation. For example:
- is this a multi-user scenario
- should an existing db be used
- is the SQL Server always when application starts
- is the SQL Server configured properly
- are backups taken properly
- and so on and so on...

As pointed out in both answers, typically local installations of multi-user databases make no sense.

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