What C# database support multi connections over shared network? - c#

I want to build a simple database program in C# to add,update and remove information.
The program should be on shared network between 3-5 computers and each could add his information in the same time.
I searched and found that SQLite isn't good for that, and don't know what will be.
I'm looking for some simple database, not something that I should install in each PC to support it.
There isn't an access to the internet, its blocked except a few websites so its not possible to use MSSQL or mySQL.
Thank you.

The fact that the users don't have access to the internet doesn't mean that you can't use MySQL or MS SQL Server. You can install MySQL on one of the computers (the one that will play the server role) and have all the other computers connect to the MySQL instance installed on the local server since you say that they will be on an internal network.
As far as Databases go, there are plenty you can use: MySQL, SQL Server, PostgreSQL, etc... Just don't use MsAccess. ;)

Related

Connect to MySQL server without MySQL on local computer

First, excuse me if I don't use the exact terms (I may do some mistakes using terms).
I am working on one program that I develop on my personal computer.
For MySQL, I installed WampServer, so I can connect to my MySQL database (on computer).
My program will be installed on CNC machines in a workshop, without possibility to install any MySQL tool (old machines).
What I am wondering is, if I make a program using MySQL library (MySQL.Data.dll), will the program be able to connect on MySQL DataBase located on the server (of course with connection to the server).
I have no experience on that point, and that's only now I am thinking about this possible issue. Any advise will be welcome.

Connect to LocalDB of other system [duplicate]

I am looking into using the new SQL Server Express LocalDB (I think it is code named "Denali") for a desktop application.
It is currently running with SQL Compact, but the user is wanting to share the database between multiple PCs on a network. Unfortunately this is not something that SQL Compact can do, so I am investigating other solutions.
The client requires the ability to send database files easily to other sites or to back them up to a flash disk, so I am avoiding going to SQL Express because there is quite a bit of "administrator" knowledge required to backup and restore.
So, my questions is, does the new SQL Express LocalDB support remote connections to the database over a network and/or through a shared network folder with the mdf file in it?
LocalDB does support supplying a path for an attached local DB in it's connect string (AttachDbFileName) hence the shared network folder option.
NOTE: This question pertains to "LocalDB" the new version of SQL Express 'Denali' and not to SQL Server Express 2008 or prior.
See article here announcing LocalDB's release: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx
No, SQL Server Express LocalDB doesn't accept remote connections.
The idea with shared network folder might work, but only if you are able to make sure the LocalDB instance is shutdown before you try to copy the file. Also keep in mind that only one LocalDB instance can have any given database file open at the same time. and don't forget about the log files!
Additional security warning: unlike SQL Server Compact databases, SQL Server Express databases (including LocalDB ones) are not designed as secure data exchange format. For instance, they can contain malicious code in .NET assemblies embedded in them. So you should never open databases from untrusted source.
Maybe providing the customer with a simple tool that automates the backup process would be a better idea?
This isn't a fresh thread, but I would like to share my experience with SQL Server Express database LocalDB.
I have a WPF C# project using SQL database with LocalDb Engine. It is working fine no problem, I can use the database with the WPF app. I wanted this app to work on network with more PCs.
On the network another PC can use the database from my PC using UNC path in the connection string.
It seemed to me the remote connection is working. However when the remote PC is connected, I am not able to use the database with my local WPF app. If I run my app first the remote PC could not connect. So this tells me that the remote connection is working, but the multiple connection is not allowed.
OK, I didn't give up and I run the app from my PC twice and I saw it is working which tells me that the same SQL LocalDB engine can handle multiple connections locally only.
I hope this experience will help someone. Thanks.
In short, yes it can. Here is a tutorial on how to configure it.
Also, here is another post with a potential issue that might occur.
Both explain how to configure SQL Server Express to accept Remote Connections.

SQL Server Express Database hosted on Network Share - Is it Possible?

I've started work on a project that requires an SQL Server Database. I will be building a front end application in c# .Net 3.5, that will use LINQ to SQL.
I need to host the database on a network share so that a group of users can all gain access to the database, mainly for read only.
I know that SQL Server Compact is designed to run on the local machine and my company is not willing to front the costs of a full blooded SQL Server.
Is there a way of achieving what I need to do via SQL Server Express?
If so, which are the best guides on how to set this up?
Thanks
If you go with the (free) SQL Server express, it will do what you need - but you don't access it thru a network shared drive - the server would be located by an ip address (or equivalent DNS).
You c# application would be talking to a service - SQL Server - not reading to/from a database file. The service will handle the interaction with the database. Only the SQL Server service will need to know where the file actually is - your client machines won't know and shouldn't care.
If your background is only with file-based databases - i.e. MS Access, you need to change your mindset a bit about how SQL server works.
You can install a SQL Server Express instance and install the SQL Management Studio Express for all users who need access to the database. The Express Edition is a standard SQL server with limitations regarding the number of processors used, the maximum amount of memory used and the maximum database size. If these limitations don't bother you, it should work fine for you.
Using a network share as a database storage to access db files from several clients is a bad idea, as the sql server instance should always be the only one directly accessing the database, both for read and write access. Configuring several instances of SQL Server to access the same database will probably not work - and if it works, it will probably create havoc in your database files.

Deploy database along with project

I need to create an application that does the following:
The application is going to be installed on multiple computers on the same network
There is going to be a computer that contains the database other computers will connect to that database. (So there is a server version of the software and a client version)
All the computers that have the application installed should be able to do CRUD (create, read,...) operations in the database.
Database will be small, that is it should be less than 1GB in size.
Problems that I have:
I don't know which database to use:
SQLite - From researching on the internet this seems like a great database. It is fast, very easy to deploy . The problem is that from researching I think it is not that good handling multiple connections. When I say multiple I mean 5 computers using the database simultaneously.
MySQL - I work with this database and I know it is great handling multiple connections. The problem with that database is that I don't know how I will be able to deploy that database. I am required to deploy a database when installing the software. I know that if I require the users to instal MySQL doing a separate installation that will work. Maybe there is a way of deploying MySQL when doploying a project in visual studio.
SQL Server Express - I believe this will be my best option. I have researched on the internet and I found out that it is possible to deploy a SQL Server Express database with a application. I believe it will be easy to figure out how to deploy such database with a project but it will be nice if someone can point me on the right direction on how to connect to that database remotely from a computer on the same network. The database will obviously be shared in the network in order to achieve this.
Microsoft Access Database - I never use this database. I know it can handle multiple connections. Maybe it is a good choice.
It will be nice if someone can point me on the right direction of how to be able to deploy a database when installing my application. Moreover how will I be able to connect to that database from a computer remotely on the same network. Since the database is small and it will just contain text I think that the best idea will be to keep the database on the internet but I cannot do that. The software is required to work without an internet connection.
EDIT
From looking at your answers it looks like I have to install SQL Server express or MySql on the server computer. The problem is that I am required to do one installation. Is there a way of deploying MySql or SQL Server Express when deploying my application. Perhaps I have to embed mysql in the application and make my application install it somehow. My boss want to be able to install the software without having a internet connection.
EDIT 2
I been thinking and this part will be very hard to implement. Do you guys have any ideas how QuickBooks implement their database? I guess I need something similar. When you install Quickbooks you perform just one installation. Quick-books handles pretty well simultaneous connections. Do they use their own database? Oracle? MySQL? I agree with all of you. It will be so easy to perform two installations. Also it will be cleaner. The software that I am creating is supposed to run on windows xp, and latter versions of windows.
If you want a dbms as your backend you are installing two things, It could look to the user like one thing, but I can tell you from bitter experience, that can be a lot of fun.
For instance to install 2005/ 2008 express, there are various prerequisites. Like a .net framework. Then there's patches and updates, then opening up the firewall(s), depends on set up. Different topology / os choices. Peer to peer, domain based, Active directory, Terminal Services, citrix.
So automagically installing without an internet connection, and using the installer for the db, is nigh on impossible, unless you have rigid control over the user environments.
Welcome to a world of hurt.
Oh did I mention permissions, shares, UAC, 32/64 bit (for sql server dmo and smo, maybe)
Do you want to block installs on "incompatible" environments.
Oh and what about upgrades. To the db, to your apps.
What if your client already has a server install and doesn't want to clutter up their kit with another...
and many many more.
And I bet you just can't wait to test all the potential combinations.
You haven't said what your target environments are going to be, so I can't say how many worms are in the tin, but its's very big time with plenty of room for lots of worms.
Ours is a long running legacy app, so we are pretty much snookered, I'd never willingly start with this design again though. Locally deployed web app would take a lot of the pain out of it.
Go back and scare the crap out of your boss.
I would recommend Sql Server Express installed on a server on your network.
Microsoft Access doesn't handle multiple simultaneous connections very well and is not very efficient when accessed from a remote machine.
You don't need to worry about deploying the database with your client application, you can install Sql Server Express directly on the server. (This only needs to be done once). You will need to configure Sql Server Express to accept remote connections after it is installed on the server.
SQLexpress supports multiple connections. So if you attach database on "server" computer you can than connect from clients same way as you would to local database.(provided those computers are in LAN or VPN).
Several articles on the Internet mention that SQLite is not that good handling multiple connections if all the connections are writing to the same database. I finally managed to deploy my application with SQL Server 2008 express. I also deployed my application with SQLite (downloaded the latest version for .NET framework 4). Since I plan to use this database just on a local network (LAN) I gave SQLite a try. I was impressed on how efficient SQLite was. I tested the Database by connecting with 4 computers symoltaniously and constantly writing data (inserts) to the database. No data was lost. When I did this with SQL express it was also very efficient and I could not tell a obvious difference. Maybe you get to see a real difference once there are 50 computers connected like on a web server for example.
Other nice things about SQLite are that it does not take time to deploy. Also there are no heavy services constantly running. I guess that SQLite is a better choice than SQL express. Moreover SQLexpress will only use 1 CPU and the database is limited to 2GB.
I am going to mist the Linq to SQL classes thought. They where very easy to implement with SQL Server Express. So in short I think that every database is good at something. And in this scenario I guess SQLite was a better option for me and for the users.
P.S.
I am interested in seeing how SQLite lattest version will hanle multiple connections compared to SQLexpress. I will try to test soon with more computers and each computer running multiple threads, each thread performing an insert in the database. maybe I,ll see a big difference with that scenario.

DBMS for POS software

I want to develop a POS application in .NET (C#) that would be used to rent items. I have a good idea of what will be done and the famous question that I have is about the DBMS that I should use. I would like to use MySQL database.
The question is: If some places use only one computer (no network, no internet connection), can I use a MySQL database in local? Do I need to install MySQL server on all thoses computers to be able to use such a database? I know SQLite but I'm not sure if the limitations can cause problems in the future... I also looked at SQLServer Express versions.
(I must consider that other point of sales are using multiple computers and more transactions so there I can't put sqlexpress or sqlite)
So can anybody suggest me what I should do in that situation?
Thanks
You would be able to use MySQL in localhost - and it would need to be installed on each local machine.
You could use MySQL. If you are sharing a database between several computers you should just be able to install the MySQL client components.
As for which database you want to use, I would highly suggest SQL Express. The security model and tooling is much better. There is nothing stopping you from using SQL Express as a shared database server until you out grow it.
SQL Express Redistribution EULA
POS systems like Open bravo POS software where special user types and hardware devices support are required.ou can use sharing a database between several computers for using sql.

Categories