SQL Databases on more than one computer [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm writing a desktop program that allows you to view customer information, as well as adding, removing, editing etc. It's to be installed onto a friends computer. The database will be stored locally on one computer. Only one user will be able to access the database via the desktop application.
If I were to publish it, and attempt to run it on another computer, would it work? Or would that computer also need SQL Server on it?

I assume you are talking about a desktop application. If this is so, you can provide your application to someone else and have them use it. However, there are different points that you need to consider:
Where will the your code reside?
Where will the database reside? Is there 1 shared copy or will each user has his own? This has a major effect on the ease of installation and the cost of your application.
If the database is shared, do you have a Server to host the database where all users will logon to?
Does the database have a max. number of users (limit/meter)?
Will the database be behind a firewall?
How many copies of the database need to be purchased?

It depends.
If you just use the most basic database connection options then either the other machine will need to have sql installed, or the other machine will need to have network access to the database running on your server.
If your application is intended for a corporate intranet having a single DB server running on the network is probably an acceptable solution. For anything else it probably isn't.
If your users need to share data I'd recommend hosting the data on a server yourself and exposing it to the end user as a web service instead of a raw database connection.
If your users don't need to share data, look into compact databases intended to be embedded in applications. Since you're using C# I'd recommend SQL Server Compact because it speaks the same flavor of SQL as Microsoft's larger database products. The other major player in this space is SQLite; which is dominant outside of the Microsoft stack.

Related

how can I save and load information in a desktop inventory application C#? [closed]

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 1 year ago.
Improve this question
Im developing this desktop app for study reasons
but im using SQL Server for database management so reading around the web i find some articles on this and why it is bad practice, i cannot move my entire project to another PC without installing SQL Server. then i find this:
Save and load inventory
So i don't know what method of saving and loading information I need for this project, I think in SQL Lite or maybe I can use a simple file to save all the information like the mentioned post.
Im using a DB with relationships and i dont know if i can made it with a data persistence file. What should I do? what is the best practice?
PD: Sorry for my bad english
Usually your SQL Server would be hosted on a remote computer when used outside development, but it depends on exactly what your application is supposed to do.
If it's a requirement for you to be able to switch computers, and not host your database on a remote server, I'd say using SQLite is a good choice.
Alternatively, you could have 1 big file that has all your data instead of a relational database, although I wouldn't really recommend it. It's good for quick prototyping of things, but all your data would be denormalized, which can end up being more effort to work with than SQL. This is what the inventory example you linked does.
If you are planing to move your application on different computers and don't want to install any database management system there then SQLite is the best option.
All of your data will be stored in one file and you can freely move your application an other PC without installing any database management system there.
Here is good article explaining that in which scenarios SQLite is good choice.

Execute queries on SQL Server without having account [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Does anyone know is there a way for an application (that's connected to SQL Server) to make SQL queries to a database, but restricts the user from accessing directly to the database using SQL Server Management Studio?
Sorry, I know this sounds very confusing, but the reason I'm asking this is because at work, I'm using an application that allows me to enter data and upload it to the database. I assume a predefined INSERT sql script were loaded into the application, but when I log in to SQL Server Management Studio it won't let me use the INSERT statement at all. I was wondering why and how a application like this can programmed??
Any info or insight on this will be greatly appreciated.
Thanks
Since you are able to access the database via SSMS without an error, the account can obviously access the database. However, permissions will be limited to those granted to the account, either directly or via role membership.
It is likely the application is using a stored procedures to insert data if you are using the same account and your ad-hoc INSERT fails with an access is denied error. When a stored procedure is used for data access, the invoking account needs execute permissions on the stored procedure but not the underlying tables. Permissions on indirectly referenced objects are not evaluated as long as the ownership chain is unbroken.
See https://technet.microsoft.com/en-us/library/ms188676%28v=sql.105%29.aspx for a more complete description of ownership chains.

Backup using linked server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
i am working on project in which we need to take backup of our database(schedule backup at Every 5 min SQL SERVER 2012) to remote server(SQL SERVER 2012) . now if server crashed for some reason then our website should automatically be connected with other server. can we use linked server for that of something else we can do
I would suggest to follow the standard solution for simple redundancy scenarios which is database mirroring. Automatic failover works with having a witness machine which handles the database communication and in case a database server fails, the traffic is redirected to its mirror automatically.
However, note that this architecture leaves you with a single point of failure, the witness. If the witness fails, you have to use redundancy strategy for it. The advantage is that this new recovery process, will not include the database recovery process itself.
Hope I helped!

Backend or database system for small business application [closed]

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'm coding a program for a small business. The application's going to be used for store-keeping and the ordering of parts for a mechanical shop. I need some type of backend to store orders, article numbers & prices, customers and so on (obviously). Right now I'm using a local MySQL server and running queries directly from the code. This is not ideal because of the risk of a system meltdown or similar. I've thought about running a local MySQL server - with a scheduled backup on a remote host, but I'm hoping there's a better solution. For previous applications I've written a PHP wrapper, and used a web hotel to host the MySQL server - Which isn't ideal either for security reasons. I suppose I should mention the application's written with windows forms in the VS .net environment(in C#). My question's this: How do I set up a MySQL server (or other type of database system) on a remote host - that I can run queries on and then return the result back to the application? Preferably I wouldn't want to handle the MySQL server myself but outsource it. I don't mind renting a server from some host - if it will spare me the hassle of setting up a local server machine to run separately. Are there any solutions that you can rent for this purpose? I'm sure there must be tons of information about this on the interwebs but I can't find anything. I would be very thankful if anyone could give me some pointers!
One way you could do this is rent a cheap VPS and host mysql in there. I have been using DigitalOcean, and it is pretty good. For your needs a $5 per month VPS would be enough.
Or you could use Azure. http://www.windowsazure.com/en-us/services/data-management/

Extending application to use on LAN [closed]

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 8 years ago.
Improve this question
I am not a very experienced programmer. And I am facing technical issues in database servers.
I have developed a small standalone C# Application which is already in use.
It uses SQLite database. The database usage is not very heavy. Only a few form needs to be read and write to the database.
Now there is a requirement that it should be used on LAN.
I know that SQLite is not a good database option for client/server.
But keeping these points in mind should I change the database or not..
The application is already using SQLite and this is not a project from start.
The database usage is not very heavy. Only a few forms will be filled and data is written on the database.
At most 1-4 Pc's will be using the application simultaneously.
I had tried to install MS SQL server on my customers PC but then I am facing so many technical issues and it is taking a lot of time.
So I am thinking to stick with SQLite only.
Any suggestions will be greatly appreciated.
So is your question "Can I share a SQLite database between multiple workstations", or "How to install SQL Server"?
I'd say go with the last. SQLite even promotes the use of a client-server DMBS if you require multiple processes accessing the same database.
Installing MS SQL server can be pain; you have to ensure .NET framework is installed, windows service pack is installed and MSI has correct version. Still I would prefer going that way, because of robustness and reliability it promotes and rather write some robust installer to "make it happen".
You can of course, keep your current solution and write web service that will lock access to database to one-client & one-query at time only and rewrite your app to use this service instead of accessing db directly.
Btw. - Microsoft SQL Server Compact Edition is working similar to SQLLite (in the terms ease of install), and it allows multiple connection to the same database (.sdf file)
http://technet.microsoft.com/en-us/library/bb380177%28SQL.90%29.aspx

Categories