Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! Windows application c# cannot connect to database without SQL server installed. I created a windows form application in visual studio(2013) c#, for customers info. Created database with SQL and then imported to visual studio with data sources.
But its not working without SQL server install. May be i need some sort of MDF to SDF conversion, but do not need a server database just local database is required.

What I have tried:

Have not idea what to do? I searched alot but may be not lucky to find a suitable answer. Please help me out.
Posted
Updated 7-Oct-17 0:46am
v2
Comments
Richard MacCutchan 7-Oct-17 6:34am    
You should use SQL CE or Express rather than SQL Server. Go to the SQL website and see what options are available.
Member 13450729 7-Oct-17 8:08am    
ok so creating database by using SQL CE OR Express, can i access my database from my application without having sql.
Richard MacCutchan 7-Oct-17 8:27am    
No, you will still need one of the single user SQL libraries to be installed.
VR Karthikeyan 7-Oct-17 6:35am    
If your data is limited, then go for SQLite.
Member 13450729 7-Oct-17 8:10am    
Yeah my data is limited to just one or two tables. but wants to access it by my application without sql installation after deployment.

1 solution

SQL Server is a multiuser system - and requires installation.
If you are planning on using your DB for more than one user, you should have SQL Server installed and use it.

If you are only ever having a single user - no data sharing at all - then SQL Server is a heavy beast for such apps, but you will have to change your code to eliminate it.
At that point, you can choose which database to use instead: SqLite, Sql Express, or even Access. You will need to modify your code to use the appropriate Connection, Command, and DataAdapter classes for your selected DB, but it will all go pretty smoothly provided your code is written well, and doesn't do anything fancy with the DB. "Standard" SQL commands are generally fine, but few single user systems support stored procedures for example.
 
Share this answer
 
Comments
Member 13450729 7-Oct-17 9:58am    
Thanks So much for the knowledge i must try SQLite.
OriginalGriff 7-Oct-17 10:07am    
You're welcome!

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