Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new at programming and I want to make an app which uses a SQL Server database. Most important feature of this database must be usable for every computer which has the app installed.
I mean, when I give this app's setup file to another person, this person should be install my app without installing SQL Server program, extra things etc. I don't know it is possible.
I created a database with "SQL Server Object Explorer" inside of "(localdb)\MSSQLLocalDB" but when I tried to add new connection, server name was empty. So I didn't import a database to my project.
So how/where can I create and import a database ?
If you want a local SQL database with your application, that is: data is not shared between devices or users, you'll want something like SQLite which is designed for embedding in distributed applications.
To use it you need to link against the binary and include the binary in your application package. Or, you can use the SQLite team's native C# SQLite library. See here: https://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm working on a small WPF Project. The data is being stored on Server machine. I want, that the clients can access that database by a WPF Software. The connection is only LAN. Any idea, how to develop my WPF APP further? Perhaps WCF? any book or any quelle that can help me specific with this topic?
thanks guys!
It depends on how your application will be used.
From a WPF application you can connect directly to your database and it is the easiest way but, not allways the best.
If your application will be used only on internal network, you can use SQL Connection, an ORM like Entity Framework etc.
But, if you want to use your application externally, I mean for exemple at home, you will need to open the TCP/IP Port on your Database Server in order to be able to connect from your application using SQLConnection. This is not difficult but will make your server vulnerable against hacker attacks. In this case, you can use a web service to publish on your server and consume it in order to communicate with your db. The disadvantage of this is the development time. Ofcourse developing a web service and consuming it will take more time to develop than connecting directly via an SQLConnection.
For me, you must choose the most optimised for your case.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Which local database should be used for C# Windows applications?
I am very confused about Localdb, SQL Server Express and SQL Server Compact.
And install on client Machine.
SQL Server Express is the currently favored option by Microsoft. It's a full database engine, but it must be (separately) installed on the client's PC, and it starts up as a Windows service in the background.
SQL Server LocalDB is a developer-oriented special version of SQL Server Express, with the same feature set, and it, too, must be installed. Other than SQL Server Express, it doesn't start up as a Windows service in the background, but it gets fired up when your application starts, and terminates when your application finishes its work.
SQL Server Compact Edition is a very different beast - uses .sdf files, is a single-user, embedded database, meaning you just need to include a few *.dll in your project, no separate installation needed. It's limited in its features, and it's no longer developed any further by Microsoft and will eventually go away
If you absolutely must have a "no-install" approach, you'll need to investigate other options, like SQLite or others.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I create an application using C# and SQL Server database, when I try to create the setup I realized that I need to install SQL Server and create the database in every computer that I install my app on.
Is there any way or software can create the setup with the database without install the SQL server in other computers?
If your storing data locally you are better off to use SQLite (as Flat Eric mentioned, it needs no installation and it efficient on small DB's) then you can just copy the .mdf files instead of having to install the entire SQL server on every machine. Visual Studio provides great functionality to help you set up a LocalDB.
Here are two useful links, They really helped me in these situations:
Upgrade to LocalDB
Creating a Local Database File in Visual Studio
Connecting to Data in a Local Database File (Windows Forms)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am new to programming in windows environment with Visual Studio most of my work is done in web and PHP .I have to build windows application for a store and the store has to add stock/make bills and sort expired products and the stuff related to stuff so what database backend should i prefer?i thought of microsoft sql but i have to install it on clients system or any simple alternative would be more helpful ?
I asked a similar question here:
Local file-based SQL Server
I had used SQL Server previously, but like you, it had to go onto a client's computer. I'm now using "Microsoft SQL Server Compact Edition (CE)" as suggested in the answer, and this works really well as a standalone database solution.
For deployment point of view I suggest you to use MS Access Database. It is most flexible and simple in use also. Check following link for same
http://office.microsoft.com/en-in/access/
I am using MDB (access database), but for the next project thinking to go for SQLite.
Reason is because MDB access via OleDb is not working in 64 bit applications. You have to compile software as 32 bit, then it will work under 64 bit OS. Or other solution is to install something, called ADE, what will add provider, which solve the issue.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am currently writing a program in C# that will connect to a database for various user data. The query I have at the moment is what would be the best practice to be able to connect to various databases from the program at runtime?
To clarify:
I may want to connect to Oracle R12, or MS SQL Server or maybe even a dumb old access database. I am fine with putting the connection methods into their respective classes, but what I really want is a config file to be packaged with the application which dictates the type of server used for each installation, the field naming convention, etc.
So should this connection file be a .dll? an encrypted text file? or something else?
Obviously I dont want the end user ready access to the connection details in case they try and do their own digging in the database outside of my application.
I would go with encrypted configuration section, it's pretty standard and there are many examples, here is MS documentation:
http://msdn.microsoft.com/en-us/library/89211k9b%28v=vs.80%29.aspx