Webservice c# free database - c#

I want to learn webservice development using c# and a free database. Could someone tell me what is the best free database solution to work with c#?
thanks

Microsoft have a free version of their SQL Server database which is SQL Express. Also they recently released a new Embedded Database which is worth checking out. MySQL and SQLite are other popular choices.
As far as web service development in .NET is concerned WCF is the recommended way.

While learning, just stick to the visual studio ide and utilize the integration with iis and sql express which should be already installed. web services in C# need iis (due to .net framework requirement for c#) plus the visual studio ide is easyily integrated with sql express. after you get some learning in, you can move towards installing and connecting to other databases like MySQL or PostgreSQL ect..

There is also sql express and sql ce

I use MySQL with c# and Entity Framework every day. It works great, and you won't be limited by the express edition of SQL Server that way.

Related

Database with application, no need of server, Visual Studio

I'd like to ask you about the simplest way how to have a small database with my application in c#, without using a server. Im using Visual Studio 2013 Professional and I used to work with Local Database and Ado.Net data entity model, but I can't see it here anymore.
Thank you guys
You can use LocalDB.
LocalDB is created specifically for developers. It is very easy to
install and requires no management, yet it offers the same T-SQL
language, programming surface and client-side providers as the regular
SQL Server Express. In effect the developers that target SQL Server no
longer have to install and manage a full instance of SQL Server
Express on their laptops and other development machines. Moreover, if
the simplicity (and limitations) of LocalDB fit the needs of the
target application environment, developers can continue using it in
production, as LocalDB makes a pretty good embedded database too.
Here's a walkthrough: https://msdn.microsoft.com/en-us/library/ms233763.aspx

Service based database vs SQL Server Compact vs LocalDB?

My goal is to create a stand-alone C# Windows form application with 2-3 tables that will be installed on client machine with a installer file. And I don't want to install SQL Server 2008 software on client machine, I'm using Visual Studio 2013 C# for development.
My options are SQL Server Compct 4.0 but I don't see Visual Studio 2013 has inbuilt support for that, when I add new item to project I don't see Compact (.sdf) file option there.
I've installed third-party SQL Server Compact Toolbox so I can create .sdf file and connectivity but I believe Microsoft is not giving support for compact db now.
I can see service-based database (.mdf) file which is actually a LocalDb\\ something.
So what should I use if I don't want to install SQL Server 2008 on client but want to have db
at client software?
You should mostly base your choice on your target platforms and the level of SQL Server functionality you expect.
Target Platforms:
LocalDB does not support older versions of Windows (e.g. Windows XP) or WoW. Toad World's LocalDB overview has a good breakdown of its target-platform restrictions.
SQL Server Compact Edition has very few target-platform restrictions. Check out its download page under "System Requirements" for specifics.
Functionality:
LocalDB better approximates SQL Server Express functionally. SQL Server Compact Edition has many functional limitations (e.g. no support for stored procedures).
MSDN's introductory overview of LocalDB explains many of the important functional differences between LocalDB and SQL Server Compact Edition; and the aforementioned Toad World LocalDB overview explains some of what (not) to expect from LocalDB functionally too.
Redistribution:
Both SQL Server Compact Edition (per the "Additional Information" section of its download page) and LocalDB (per SQL Server forums) are freely redistributable: so you should be okay with either with respect to fine print.
maybe SQLite would be an option? check out: http://www.sqlite.org/
it's just a DLL/Assembly you need to reference and it's pretty straightforward..

Sql server compact for windows app using visual studio 2010

I am working on windows app where i need to use sql server compact . I tried various articles for using it in visual studio 2010
Private Installation for SQL Compact
Working with SQL Server Compact in Visual Studio
but didn't get any satisfactory answers .Please suggest me best solution available for this .
If you use the nuget package (http://nuget.org/) you can simply look it up and install it. Otherwise you just copy the sql server compact dll's to your exe directory and include System.Data.SqlServerCe.dll
There are various different ways to interface with a database. As an OO framework .net has various abstractions for database access. The main ones are (vanilla) ADO.NET (not recommended), EntityFramework, nHibernate and LinqToSQL (not recommended). They will all work with SQL CE very well.
Given what you have described so far I would recommend EntityFramework CodeFirst SQL CE. Scott Gu has a good blog on an old version of this tech. I would start by just installing the premade nuget for SQL CE EF.

Redistributing the .NET framework and SQL Server Express

I have an app written in C#. It's a commercial app, written using nothing but free software (Visual C# express and SQL express). So, so far it's all clean.
For the app to work, both the .NET framework and SQL Server Express need to be installed on the clients computer. I already know some of the clients don't have internet connection (for security reasons), so I need to make an installer that would locally (off line) install all the dependencies (.NET framework and SQL Server Express).
So, can I (legally) burn both the .NET framework and SQL Server Express installers on the instalation CD so that the client can just click install and not have to worry about anyting?
I tried contacting Microsoft directly to ask them, but I had no luck.
Well, this Microsoft page will tell you what you needd to redistribute SQL Server Express. And here's a link about redistributing the .NET framework.
Basically, you don't really have any major restrictions when it comes to redistributing either of them. Just dig around the Microsoft website and you'll find everything you'd ever need.

Connecting to SQL Server with Visual Studio Express Editions [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I find it odd that in Visual C# 2008 Express edition, when you use the database explorer, your options are:
Microsoft Access
SQL Server Compact 3.5, and
SQL Server Database File.
BUT if you use Visual Web Developer 2008 Express, you can connect to a regular SQL Server, Oracle, ODBC, etc.
For people developing command-line or other C# apps that need to talk to a SQL Server database, do you really need to build your LINQ/Data Access code with one IDE (Visual Web Developer) and your program in another (Visual C#)?
It's not a hard workaround, but it seems weird. If Microsoft wanted to force you to upgrade to Visual Studio to connect to SQL Server, why would they include that feature in one of their free IDEs but not the other? I feel like I might be missing something (like how to do it all in Visual C#).
You should be able to choose the SQL Server Database file option to get the right kind of database (the system.data.SqlClient provider), and then manually correct the connection string to point to your db.
I think the reasoning behind those db choices probably goes something like this:
If you're using the Express Edition, and you're not using Visual Web Developer, you're probably building a desktop program.
If you're building a desktop program, and you're using the express edition, you're probably a hobbyist or uISV-er working at home rather than doing development for a corporation.
If you're not developing for a corporation, your app is probably destined for the end-user and your data store is probably going on their local machine.
You really shouldn't be deploying server-class databases to end-user desktops. An in-process db like Sql Server Compact or MS Access is much more appropriate.
However, this logic doesn't quite hold. Even if each of those 4 points is true 90% of the time, by the time you apply all four of them it only applies to ~65% of your audience, which means up to 35% of the express market might legitimately want to talk to a server-class db, and that's a significant group. And so, the simplified (greedy) version:
A real db server (and the hardware to run it) costs real money. If you have access to that, you ought to be able to afford at least the standard edition of visual studio.
Workaround:
Open your solution in Visual Web Developer Express. It will not load some of the projects in the solution but it is ok.
Make a new connection in Database Explorer to the required database from SQL Server.
Add a new class library project.
Add a LINQ to SQL Classes item and link it to your database.
Close the solution.
Open the solution in Visual C# Express.
Now you have a LINQ to SQL classes library that is linked to your SQL Server database in Visual C# Express.
Update
The solution is for Visual Studio Express 2010.
My guess is that with VWD your solutions are more likely to be deployed to third party servers, many of which do not allow for a dynamically attached SQL Server database file. Thus the allowing of the other connection type.
This difference in IDE behavior is one of the key reasons for upgrading to a full version.
If you are using this to get a LINQ to SQL which I do and wanted for my Visual Developer, 1) get the free Visual WEB Developer, use that to connect to SQL Server instance, create your LINQ interface, then copy the generated files into your Vis-Dev project (I don't use VD because it sounds funny). Include only the *.dbml files. The Vis-Dev environment will take a second or two to recognize the supporting files. It is a little extra step but for sure better than doing it by hand or giving up on it altogether or EVEN WORSE, paying for it. Mooo ha ha haha.
The only way I was able to get C# Express 2008 to work was to move the database file. So, I opened up SQL Server Management Studio and after dropping the database, I copied the file to my project folder. Then I reattached the database to management studio. Now, when I try to attach to the local copy it works. Apparently, you can not use the same database file more than once.
I just happened to have started my home business application in windows forms for the convenience. I'm currently using Visual C# Express 2010 / SQL Server 2008 R2 Express to develop it. I got the same problem as OP where I need to connect to an instance of SQL server. I'm skipping details here but that database will be a merged database synched between 2-3 computers that will also use the application I'm developing right now.
I found a quick workaround, at least, I think I did because I'm now able to use my stored procedures in tableadapters without any issues so far.
I copy pasted an SQL connection that I used in a different project at work (VS2010 Premium) in the app.config and changed everything I needed there. When I went back to my Settings.settings, I just had to confirm that I wanted what was inside the app.config file. The only downsides I can see is that you can't "test" the connection since when you go inside the configuration of the connection string you can't go anywhere since "SQL Server" is not an option. The other downside is that you need to input everything manually since you can't use any wizards to make it work.
I don't know if I should have done it that way but at least I can connect to my SQL server now :).
EDIT :
It only works with SQL Server 2008 R2 Express instances. If you try with SQL Server 2008 R2 Workgroup and up, you'll get a nasty warning from Visual C# 2010 Express telling you that "you can't use that connection with the current version of Visual Studio". I got that when I was trying to modify some of my tableadapters. I switched back to an SQL Express instance to develop and it's working fine again.

Categories