Visual Studio Database without SQL Server - visual-studio-2010

I want to make a Windows Form win32 application in Visual Studio 2010, but I know nothing about SQL. Can I create a database without a SQL Server? The information I will be storing will need to be filtered and calculated later.

You can use SQL CE Database instead of SQL Server. You can get more information about the difference between SQLCe and Sql Server Express
http://sqlserverpedia.com/blog/sql-server-bloggers/sql-server-%E2%80%93-difference-between-sql-server-compact-edition-ce-and-sql-server-express-edition/
http://blog.sqlauthority.com/2009/04/22/sql-server-difference-between-sql-server-compact-edition-ce-and-sql-server-express-edition/

Can I create a database without a SQL server?
Sure, you can MySQL, SQLite or any other provider that operates well with ADO.Net. Why don't you want to use a SQL Server though? Any particular reason?
There's also SQL Server Express that has a 10GB database limit, which is more than enough for a small application. Plus, it's 100% free.

Related

EF4 connection problem

I'm working with Visual Studio 2010 express and MSSQL 2008 R2 express.
I've created model from DB tables.
Now I have problem with connection.
When I connected to DB with Management Studio, I can't run my project, I'm receiving exception with message "The underlying provider failed on Open".
Restart of SQL instance helps, than I can run my project and work with entities, but after that I can't connect to DB from Management Studio.
To connect successfully, I need to restart SQL server instance again.
Are there some ways to do that simultaneously?
It sounds a little bit like your database might be set to Single User Mode, have you checked that?

Is it possible to use Windows Authentication to connect to a SQL Express db?

I've been looking around to find an answer to this question, and seeing lots of different answers, some of which don't look right to me. Here's my problem.
I've created a SQL Server 2008 Express database, and populated it with tables from 2 regular SQL Server databases (it's to receive data from the 2 databases). I've done this using Windows Authentication.
Now I want to test deploying an app, as a ClickOnce application, so I've written a bare-bones console app in VS 2010. Next I tried to add a new data source to the SQL Express 2008 database. But when I try to do that I get a message saying, "This file is in use. Enter a new name of close the file that's open in another program." (I'm running VS 2010 as an administrator on my Windows 7 Ultimate box, which was one of the answers someone gave to fix this problem, but isn't working for me.) I don't have the SQL Express db open in SSMS or anything else. One solution I've read is to get into SSMS and detach the .mdf, but then how would I do maintenance, like create new SP's, views, etc? Is it a maintenance nightmare of attaching in SSMS while not in VS 2010, do DBA work, then detach the DB, get into VS 2010 do work, etc?
The database is meant to run on the user's machine; not a network share.

Cannot connect to Sql Server database: non-system databases are not shown

I'm trying to connect to SQL Server 2008 express database from Visual Studio 2010 using data connection wizard. I choose new connection -> MS Sql Server then I choose the only available server name (PAVEL-PC\SQLEXPRESS). The problem is i cannot see my database in the combobox below. System databases (like master, model, msdb etc) are shown though.
I've managed to find similar questions (like this one: Cannot connect to SQL Server database in Visual Studio because my database isn't there) and it seems I'm having permission issues. However I cannot understand which user (and where) should I add.
The account name which I'm running my Visual Studio on is Pavel. My computer name is Pavel-PC. I'm not sure what my SQL Servers account names are, but it was installed using default settings.
Here is the answer to my question:
use "PAVEL-PC" instead of "PAVEL-PC\SQLEXPRESS"

How do I open a SQL CE4 .sdf database file?

I installed Microsoft WebMatrix, which, I believe comes with SQL Server CE4. I've tried opening the SDF file in SQL Management Studio (SQL 2008), but I get the following error message:
-------- Microsoft SQL Server Management Studio:
There is no editor available for
'C:\efTest\App_Data\SchoolRepository.sdf'.
Make sure the application for the file
type (.sdf) is installed.
How do I view/modify my .sdf database?
I see there is a similar question on StackOverflow (http://stackoverflow.com/questions/4070860/sql-compact-4-0-cant-open-read-sdf-file) but I would really like to use Management Studio if I can, and not another 3rd party tool.
Have you tried the SQL Server Compact Toolbox?
or the SQL Compact Query Analyzer?
You can download sql ce through web api just follow this link
visual-studio-tools-for-sql-serverl
to do that.
Here are a couple which have worked quite well for me in terms of connecting to SQL CE 3.5 and 4.0 databases:
LINQPad - (See my remark to question) It works quite well plus it allows for specifying LINQ or SQL for queries.
CompactView - Seems pretty full featured + install creates a nice Windows file association so one can simply double-click to open/connect to .sdf files for instance.
All of the other options require SQL CE 4.0 Database Provider installed on your machine.
This one doesn't need provider http://sqlcequery.codeplex.com/
If you are using Visual Studio 2015, 2013, 2012, 2010, try SqlCeToolbox.4.5.0.3.vsix. It is SQL Server Compact/SQLite Toolbox for Visual Studio.
The link:
http://www.sokhawin.com/how-to-open-sql-compact-edition-file-sdf-in-visual-studio-or-linqpad/
It has ability to open and edit.

Creating SQL CE4 databases

I've downloaded the RTM version of SQL CE (Compact Edition) and installed it. I've installed the SQL Server Compact Toolbox. I understand that SQL CE4 support within Visual Studio won't happen until SP1 drops.
The problem is, while I have tools to edit the CE Database, I can't find a way to actually create a SQL CE4 database. I figure I must be missing something obvious, but 20 minutes of searching hasn't turned up anything. How do I create a SQL CE4 database?
Thanks,
Erick
Edit: I would rather avoid installing and running WebMatrix.
The SQL Server Compact Toolbox also allows you to create a database file (via the Add Connection dialog)
There's probably a better solution, but you could try out WebMatrix. With it I created an Orchard site, but after creating the site you can create new databases by clicking the 'New Database' button.
Really easy. Don't think this is the best option though...

Resources