.Net Best sql server to use - c#

HI, I'm trying to create a simple database for my C# .NET application. It's easy enough to create a db and to run it locally, but I was wondering which is the best free one I should Use? Furthermore, I would also like the application to be easily deployable on multiple PCs (each with their own local db instance). What is the best tool for me to use?

SQLite is very popular.
http://www.sqlite.org/
I would also add they have fantastic support across many platforms and uses:
http://www.sqlite.org/whentouse.html

Take a look at the latest SQL Server Compact Edition. It's designed to be embedded so you can easily deploy with the right files added to your install / copy setup.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0d2357ea-324f-46fd-88fc-7364c80e4fdb&displaylang=en

Postgres if you need this to be a serious solution, SQLite if it's a lightweight concern.
For my money, Nhibernate support is the important question.

If you're using .Net, why not use SQL Server Express Edition?

The Microsoft answer is SQL Server CE (Compact Edition): http://www.microsoft.com/sqlserver/2005/en/us/compact.aspx
There is an isntaller, but it can also be deployed just by including a few DLLs.

The obvious answer should be the express edition of SQL Server :
http://www.microsoft.com/express/Database/
Personally I just use microsoft access most of the time for simple stuff.

Note that may users are suggesting SQL Server Compact Edition. It could be useful to know the difference. CE is much more limited, but easier to deploy. Sounds like CE is the better choice for your application.

Related

Best way to create database application in C#

I'm wondering what's the best way to create an database application using VS C# 2010 Express Edition and I have two questions:
What should I choose Microsoft SQL Server 2008 or SQL Server Compact
3.5? 2008 seems to be more complicated to install on user's desktop. If I am right, to use Compact you only need to install this
server and after that application is just able to use database
file.
What should I include into my package, .dll file will be enough or do I need whole for example Sql Server Compact installer?
You may use LocalDB from new SQL Server 2012 Express. I thing it's ideal for desktop apps. More info at MSDN and SQL Server Express WebLog.
Just to add, might help...
I'd suggest to use NuGet to download / install EntityFramework (type it in there and you'll get a list).
You have two versions, one regular flavor and one for compact edition.
http://nuget.org/packages/EntityFramework/4.3.1
http://nuget.org/packages/entityframework.sqlservercompact
And with that you'll get a basic 'framework' for dealing with databases as well (you'd need just to install the SqlCE (suggest 4 as is newest)) - NuGet installs the dll-s needed.
You can use 'model first' approach with EF (entity framework) to create Db first,
or even better use 'code first' approach - to create Db automatically from your code, classes.
That'd take care of creating new Db etc.
I think that's the easiest way to 'start up' with a new Db. And CE as well.
CE (compact) is a good choice - but watch, it has certain limitations comparing to the standard server SQL (express or standard etc.). E.g. you cannot use I think xml fields, and some other things, stored procedures, views etc. (If I'm correct and remember from before).
Also depends on what you want to make and where to deploy. Desktop doesn't mean that CE is best solution (depends on many details).
hope this helps
MSDN has some documentation on how to deploy SQL Server Compact with your app. It's indeed possible to both install it separately, or bundle it with your application, which is probably what you want.

WPF and local database, which one to choose?

I am working on WPF application, and now I have to choose which database to use. It will be local database.
I am thinking about SQLite, but I am not sure. I am not sure how much data my database will contain, maybe a lot, it depends on users use of application. In that case maybe SQLite is not good solution.
Maybe it is best solution to get use Microsoft SQL Server Express.
I would choose the MSSQL Express Edition because its the most well intergrated with .Net. And if you need to upgrade to Standard Edition its fully compatible you just upgrade it without change anything.
I recommend Microsoft SQL Server Compact Edition.
If you want to go with open source databases to cut down the cost MySQL is the ideal solution. it's competent to the MSSQL Server and one of the top most open source databases.

C# and MySql integration

How well does C# integrate with MySQL ?
I am planning to write a small desktop application that connects to a Database and displays records. Is C# and MySQL a good combination ?
Should I use Java Swings and MySQL ?
Thanks in advance
Yes, it is. You can use MySQL .Net Connector as mentioned.
Or better, you use ORM ( such as NHIbernate) to abstract away the database vendor. I use NHibernate with MySQL in my C# application and it works well.
As Ralph Stevens suggested, you'd better go with SQL Server 2008 Express. Visual Studio 2008 integrates neatly with it and can generate Linq To Sql plumbing code right off the database. With a few clicks you are ready to handle the database in every way imaginable.
If you code ASP .NET, there is an added benefit: The mdf file that contains the actual database information can be stored in the App_Data folder and that goes with the project itself rather than the database engine. That comes in handly when you distribute the code to coworkers.
MySQL would work just as well with its .NET Connector but you will lose the visual benefits.
They integrate quite well. You can use ODBC, or better yet, the new MySQL .Net Connector.
May be this links be use full for you, was for me, when I started :)
windows-programming.suite101.com and
bitdaddys.com
How big is your database requirement? .NET works much better with SQL Server. SQL Server Express can go up to 4 Gigs of data and it's free. It meets the requirements of most small to medium apps. I suggest SQL Server Express.

What are some good sql databases for home Vista computer?

I have been trying for a long time to get SQL Server Express on my computer to practice my C#/SQL with and I still haven't gotten it to work.
Are there other programs I can use to setup an SQL database to practice with? If so, which are the best ones for Vista?
EDIT:
To be clear I am not new to SQL programming, I just haven't done any in a while and want to stay fresh. So I would like something that has most of the features of forms of SQL I would use professionally.
MySQL or Postgresql are both full fledged DB's and good for education/experimentation. You can also check out Oracles free version.
SQLite is good if you need something fast, small and powerful... its a fast download also.
SQLite
SQLite with C#
What aren't you getting to work for Sql Express. It works on Vista. I use it on a daily basis. It no longer comes standard with a "northwind" database, but you an download the AdventureWorks DB. Can you be more specific about "I still haven't gotten it to work"?
I've also heard good things about firebird
Although I still believe that C# and SQL Express is the best way to go.
SQL Server Express generally should be the natural choice for practice with .NET and C#.
If you have no prior experience in working with SQL Server and its Express version one most confusing thing is that SQL Server Express is not installed as default instance, but as SQLEXPRESS instance. So you have to use "Data Source=.\SQLEXPRESS" in your connection string.
In case you can not overcome issues with SQL Express you can try Postgres, but you will need to download and use .NET Data Provider for Postgres.
I preferr Firebird its a madure BD and its O.S. very stable btw.
http://www.firebirdsql.org/
and try ibexpert for manager this bd.
http://ibexpert.net/ibe/
Both Oracle and IBM offer offer versions of their flagship databases for free in a similar manner to SQL Server Express. Both are excellent products if you wish to play with a 'real' database system.
Oracle 10g Express
IBM DB2 Express
Postgres is also well worth considering as it is also a 'real' relational database, having originally started as the much respected Ingres RDBMS in the 1980s. However Postgress until recently was Unix-based and I've never found it particularly reliable installing on Windows.
Personally I would not recommend MySQL for your scenario - although the latest edition can finally be described as a RDBMS having evolved from what really was a collection of flat files with a limited SQL query interface it's peculiarities probably mitigate against it's use as a learning tool unless you are actually focused on MySQL.
There are a number of other less popular RDMSs you could consider. Firebird has always been something of a favourite of mine as I used to code a lot of Delphi, and SQLite is a joy to work with in many circumstances. It's also a pity you cannot use SQL Server Express as the SQL Server product range is simply the most solid product Microsoft produces and usually my database of choice on anything but the smallest, largest or most unsual installations
Vista DB is quite a nice lightweight managed flatfile database (not related to Windows Vista).
For something very simple look at sqlite It supports most SQL syntax and stores it's database in a single file so has very little setup. You'll need an ado.net data provider for it which you can find here Although it isn't a good choice for multi user systems with lots of data it should be fine for an introduction to database programming.

Single-user database options

I'm going to be writing a Windows application using the .NET framework and C#. The application will need to store relational data which will be queried, joined and processed.
Previously I've done this using SQL Server, but that is a total overkill for the application I am now making.
What's the simplest, easiest way to store relational data in my application? If I was on a Mac, I'd be using SQLite. What's the .NET equivalent?
If you are using VS 2008 and .NET 3.5, you can use SQL Server Compact Edition. It's not really a server at all, it runs in-proc with your app and provides a basic SQL database. The databases themselves are a single .sdf file and are deployed with your app. Since it's part of the framework, it also means there's no additional installation. Actually, It's not actually part of the framework, but it's easily redistributable. I'm using SQL Server CE for a personal project I'm currently working on, and it's turned out great so far.
SQL Server Express is what you want. It's free IIRC and easily scales into full-blown SQL Server when required.
Why cant you use SQLite? It works on windows.
SQLite Quick start.
Also see here for getting it to work with .NET http://web.archive.org/web/20100208133236/http://www.mikeduncan.com/sqlite-on-dotnet-in-3-mins/
So you could use SQLite if you wanted to but perhaps as others have pointed out SQL Express is a better option as you can upgrade to a full server if you need to in the future. Although from what you wrote i don't know if that's likely.
Sqlite is definitely the best option for embedded database for application storage.
It is free fast and reliable.
Sql Server Compact Edition (*.sdf files). Small enough for Smartphones but also available on the full platform. The .net 2 version was called Sql Server Mobile.
Here is a comparison between Compact and Express.
I haven't used it yet but if I was making a windows application and needed functionality similar to this I would use the built in windows database that's already on every single box of windows.
http://www.codeplex.com/ManagedEsent
You can use SQL Lite with .NET. In fact, if you are willing to keep your code so it can translate to mono, which encompasses most 2.0 (3.5 still upcoming), you can run your code on the Mac, as well, if you stick with SQL Lite:
http://mono-project.com/Main_Page
It really depends on how much bang you need. SQL Express, which has been mentioned numerous times in this thread, is SQL Server. It has some restrictions over full blown SQL Server, but it is the full SQL Server engine, so it is not a lite version, unless you think restricting a database to 4 GB makes it light. If you need heavier services like some Reporting, some message queueing (service broker), then SQL Express 2008 is your creature.
For lighter in the MS world, you can go with SQL Compact. As with SQL Lite, it is limited in scope, but you stated you need a lightweight database.
If you are really familiar with SQL Lite, I see no reason not to head that direction. Add a factory on top of your database access, just in case you change your mind. Then you will not have to rip up your entire app to switch databases.
Microsoft JET Blue.
If not sqlserver express, You may want to conisder Microsoft SQL Server Desktop Engine ( scaled down version of sqlserver) which is free in most cases. or MySQL which is also free. I'prefer mysql.
SQLite
Firebird
MySQL Embedded
I would say Microsoft Access. You need a licence though ...

Categories