Is there a possibility to create and access Oracle Database files from anywhere in the file system? I want to connect with C# and Entity Framework or NHibernate.
Background is we need to create a folder in the filesystem which represent a project and contains
the database itself
a very complex file and folder structure
the user wants to copy the folder to a new PC, and work with this project
I know SQL Server compact supports such scenario but we need Oracle as DBMS.
No. Oracle has no feature like that. Database files are created on the database itself, and they aren't as portable as SQL Server database files.
Related
My C# .NET (4.5.2) application accesses a local SQL Server (13.0.1601) database.
For data archival purposes my client wants to pack a snapshot of the program and the database in a folder to run the old state when needed.
How can this be achieved with no running SQL Server service but only the folder contents and an installed .NET runtime?
Options considered so far are exporting the database to .bak or .csv and putting them in the folder, but those seem to involve a lot of manual labor.
As mentioned in the comments by marc, you need to have a SQL instance running to use a backup file.
Exporting it to a .bak file is not a "lot of work" - it just involves logging in to the SQL Server (from the application) and issuing the right SQL commands.
But in order to view this again you will have to re-import it back into a SQL instance - this is the reverse of the step above (although obviously you will have to rename it because your original database will still be resident in the SQL instance).
If you are looking to avoid having a SQL instance (service) installed then maybe SQL Server Express LocalDB is an option for you - it runs totally in memory.
You could create a script to export the tables as CSV and modify the program to use q to run its sql queries directly to those CSV files.
There is no embedded version of SQL Server. The closest thing is the LocalDB feature available since the 2012 version - it does require installation of some SQL Server components but does not require running a service. With it installed, you'd attach the MDF and LDF files (read-only if necessary) of the snapshot.
I'm making a C# application that uses a local database created with SQL Server
But when I create the database I used a connection to the local database with a file path on my local hard disk, and when I install the program on my computer it works correctly, because it is connected to the same database on my hard disk.
But when I publish my application and install it on a different computer it can't connect to the database because the connection in the C# code uses the same file path in my computer.
So now I create another database in C:\Program Files\Application Folder and make a connection in C# code with the same database. When I install the application on another computer how can I make a copy of database with the tables, because when I make a copy on the database it doesn't contain the tables.
Please help if you can.
I think you can connect the database in the local network. And if you want to copy the database, you can attach your database file in the SQL server in the computer that you want to apply.
I would save all the creation scripts. When you create a new table, I would save the script that was generated. I would then tell the program to launch the scripts when it installs.
hi I want to use Entity Framework for my Application. With my Application I create a Helpdesk Ticket and I want do this without install a Database on the server. for this I want to create only a file with the database data and content.
For SQL Server Express can I use mdf files. Is it possible to create a file how mdf or something.
The models are finish and I have a Context.
I ask this because a workmate ask me. He find it better if the application (asp.net mvc) start and on the server would be create a database file that save in a seperade folder, that I can select by the installation.
Have I a Change to do this?
here is the problem I am facing now. I have created an application that uses local database (this was created by Add -> New Item -> Local Database. Afterwards I have added tables under this .sdf database.
Then I have connected to this database using Add -> New Item -> ADO.NET Entity Data Model.
Everything works like a charm, unless I was asked to move this database to a place, where multiple people could access this database and work with it.
Therefore, as I have no previous experience with databases, I have treated this .sdf file as any other file (let's say Excel workbook) and I thought that I could simply take already existing database, copy it on server computer (e.g. \Server001\Database\Database1.sdf) and simply change connection string under app.config.
However the problem is that this does not work. As I didn't know how to change connection string, I created new application, where I have tried to connect to this database located on a server computer; however I received the following error:
SQL Server Compact does not support opening database files on a network share.
I already have fully functioning program, but I have no idea how to make it work with multiple users. I have tied to google for solution, but all I could find is how to create local database, not how to make it accessible by placing it in server computer.
Could you guys please help me? If you need more details, please let me know!
P.S. This is WPF application, .NET 4.5, created using Visual Studio 2012 Professional.
Thank you!
The error message pretty much sums up the problem: SQL Server Compact does not support opening database files on a network share.
SQL Server Compact (aka "local database") is to be consumed by a local application; even if it was a web app serving many requests, the application itself is local.
If you want to have multiple remote connections (i.e. centralized DB, distributed app), you should look at using an instance of SQL Server (any SKU would probably work, even SQL Server Express). Those will use MDF files instead of SDF files, so you might want to refer to Convert .sdf database to .mdf database. You'll probably also need to set up a user identity for your connection string, so check out this link on CREATE USER and Difference between a User and a Login in SQL Server to understand how that can be configured.
I am creating an application for some user to maintain records in database. For this, I'll have to write SQL query (C#) and create the database, if does not exist, when user starts/installs the application. To make the creation and backup procedure easier, I want to create a separate file for SQL Server that will be used to store data. This file will be included in installation pack and copied to the destination folder to be used by SQL Server.
I've seen that we can create such file but never used like this.
Is it possible to accomplish the job I am trying to do?
i think that if each application have its own db you should use or SqlCe or SqlLite
They are a self-contained, serverless, zero-configuration, transactional SQL database engine.
So you don't have to install sql express on every pc.
They use a subset of tsql and you can do almost the same thing as sql server
you could embed a file in the application with all the sql command to create the db and then execute it the first time the application start.
Anyway you can distribute your app with the db already created and ready to use: it is just a .sdf file
If you think to distribute your app with clickonce than Sqlce is better becouse clickonce recognize its file format and handle it during the application updates
If you want to use SQL Server, you can use the Compact Edition: http://msdn.microsoft.com/en-us/data/ff687142
SQL Server CE databases are stored in .sdf files (up to 4GB) that can be shipped with your application. That way, if you want to connect to a full SQL Server database later, you could just change the connection strings in your application config.
You could make a backup and then restore it http://www.dotnetspider.com/forum/162986-database-backup-restore-through-C.aspx