What's the deal with databases in C#? I'm used to using MySQL in PHP, but my confusion is this.

If I develop an app, and sell it on, would the end user need anything installed? How do other app developers store data that's quick and easy to access?

Any help on this would be great.

The app I am working on needs to store inputted data, and use that data. I've read about SQL with C# but if I use that, won't the end user need SQL installed to?

Thanks for any insights.

Recommended Answers

All 8 Replies

If I develop an app, and sell it on, would the end user need anything installed?

That depends on what kind of database you want to use... if it's a server-based database, like MySQL, and you don't want to host it yourself, then yes. I don't recommend actually requiring users to install database servers, however.

How do other app developers store data that's quick and easy to access?

The app I am working on needs to store inputted data, and use that data. I've read about SQL with C# but if I use that, won't the end user need SQL installed to?

If the database isn't user-specific, you might consider hosting the database yourself, which avoids the user having to install any extra software. If it is user-specific, you could also design the database for multitenancy, if it's appropriate to your application.

Otherwise, you're left with serverless databases. SQLite (there are ADO.NET providers available) and SQL Server Compact (if you don't mind registering for redistribution rights) come to mind. I'm sure there are others out there as well.

If you're willing/able to consider other options, the .NET framework has a lot of support for XML and related technologies, which I've found very useful for simple data storage and retrieval.

I agree, it depends on the type of application, company you are selling this to, and how many users will be using it.
What I usually do is incorporate a database such as Microsoft access with my application if there is only going to be a few users. This way I can include the file in my exe application without a problem. This way, the first time the user runs the application, the database file writes to disk in the background ready for use. If you would like me to demonstrate how to do this then please ask and I will show you.

If your database is for a large organization, it is best to discuss this with them first to see what database they are licensed for and/or comfortable using. Then you can simple create scripts for them to run on an already installed back end database to install your own database on this.

Hope this helps a bit

well you have to install the database on user machine, but if you are using MS Access, then there is no need to install that database on user machine...........
hope it helps you:)

The database needs to be on the users machine.

So basically if I use an MS Access database the user does not need MS Access installed? If so, that sounds like a great solution, as long as it's possible to hide the file fromt he user.

The database won't be big enough to warrant a larger database, but it would be to big/tedious for a flat file or CSV solution.

I believe you can use the .NET dlls to get access working without having the access application installed on the client machine. Depending on the size and scope of the application I would still highly recommend using SQL Server. Explain what your application does in a little more detail, how many people you expect to use it, etc.

I believe you can use the .NET dlls to get access working without having the access application installed on the client machine. Depending on the size and scope of the application I would still highly recommend using SQL Server. Explain what your application does in a little more detail, how many people you expect to use it, etc.

The application is basically an auto responder. It manages multiple business mail accounts and auto responds to double opt-in's.

What needs to be stored is:

- SMTP Server details
- POP Server details
- Auto-responses (allows the user to compose x responses)
- Schedules (Users can set to respond to all emails at a certain time of a day)
- Custom app configuration

The app will be used by around 200 users, but all from different locations in the world. It will be used more by Internet Marketers as the app allows you to do custom mail shots to opt-ins.

How do programs like Thunderbird store data?

I never heard of thunderbird until now but I took a look at mozilla's thunderbird FAQ and found:

Thunderbird's mail files are in the standard plain text "mbox" format, which almost all mail programs can use or import. Many proprietary mail programs have a function to import from Eudora, which also uses the "mbox" format; this function should read your Mozilla mail files properly.

Your mail files are inside your profile (see the Profile Folder), in the Mail and (if you use IMAP) ImapMail folders. Each mail folder (Inbox, Sent, etc.) is stored as two files — one with no extension (e.g. INBOX), which is the mail file itself (in "mbox" format), and one with an .msf extension (e.g. INBOX.msf), which is the index (Mail Summary File) to the mail file. Tell the other program to import mail from the file with no extension.

If you want to transfer a mail file to another Mozilla profile or another installation of Mozilla, simply put the mail file into the other installation's Mail folder.

How does SQL Server Compact Edition sound? If you use standard/express sql server you will need a full time technician to help with deployment issues but with SQL compact the database is accessed by the application in-process. Microsoft published a compact vs express feature comparison. If you go this route you could deploy your application with a local SQL database and structure your application to use microsoft TSQL so in the future you could also connect your application to a full blown SQL server without changing any code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.