This might sound a silly question but I've really spend hours in trying to find a solution...
I have a local database on SQL Server and it is used with a C# application.. The only way I view the database is through SQL Server.. It is accessible and altered in my application when I am running the application on my developing PC, but when I run it on another PC the database is not found (obviously) .. How can I include the database sources when I am compiling the program, (so that it would be also found when I run it on other PCs) ?
Initially I used SQL Server CE and I achieved portability, but I had to include stored procedures, and this edition doesn't accept them :/ so I had to turn my attention to the latter type.
Sorry for my terrible English ! :(
Thanks in advance
How can I include the database sources when I am compiling the program, (so that it would be also found when I run it on other PCs) ?
You can't. SQL Server license prohibits distributing parts of it like that, plus there is no documented way to do that. If you need SQL Server on the box, it needs to come from the installer. You can create an installer for your own product, and your installer can install SQL Server if it's needed as a prerequisite.
Alternatively, you could look at other database options such as SQLite for a file-based database. You can distribute the components of SQLite.
If you need a local sql server on each pc where your application runs then you should look into the Express edition of MS SQL Server. It is the free with limitations version of MS SQL Server.
Related
I need your help to answer a question.
I coded a basic c# portable exe application that uses an Access Database on a server computer. On the network there are some client computers that runs this application and retrieve and store data via this database placed on the server computer in a shared folder. Every client coputer can access my database with this connection string:
#"Provider=Microsoft.ACE.OLEDB.12.0;Data Source =\\ANKFILESERVER1\aractakip\DatabaseAd.accdb
So far, there has been no problem. But as known, Access (Oledb) database has a limited capacity to save datas and since i'm worrying that someone change or delete my database files -authenticated for everyone- i decieded to use another database platform like postgresql.
My question is, if i install postgresql on the server computer and migrate my database tables, Are every client computers needed to install postgresql to access my database tables? If yes, what should be my connection string?
Thanks in advance.
You will need a client driver - like psqlODBC - installed on each computer that connects to PostgreSQL via MS Access, yes.
You can install psqlODBC separately, or using the main PostgreSQL installer. The separate psqlODBC-only installer is an msi that can be deployed over Active Directory, making management easier.
The connection options are covered in the psqlODBC documentation.
Microsoft Access is really written for the Microsoft JET / OLEDB engine, and to communicate with Microsoft SQL Server. It works with PostgreSQL, but it doesn't fully "understand" all PostgreSQL's features. It also does some things in totally non-SQL-standard ways that work on MS SQL but do not work on PostgreSQL. So it can be awkward to use MS Access with PostgreSQL due to things like Access not really supporting SEQUENCEs properly. Note, though, that I haven't used Access since Office 2008, so things may have improved.
I have a C#.NET application which connects to a MySQL database in a server.
I have a requirement to do some operations offline.( When the client machine does not have internet and cannot access the MySQL database.) My Plan is to create a MySQL database in local machine. Copy all files required to the local database and perform required operations. When the client machine have the access to the MySQL sever copy back the changed files to the server database.
My question is what are the good Options to use as local MySQL. Is there any lighter version of MySQL available?
I also need to install selected MySQL version with the windows installation package generated for my software.
Thanks in Advance.
When I have these situations I usually fall back to SqlLight. Its a simple embeddable database, and if you are using only the simplest insert /select statements you should not need to maintain much difference between your local database access vs the remote database access.
That said. If you are using something that is not that simple it's usually a good advice to bite the bullet and do the whole mySql install thing on the local machine. Because the maintenance of 2 sets of database access will eat up development time like nothing else.
In your case I would use an embedded database with your offline application, something like FireBird where you don't need to install a 3rd party database etc. The FireBird dll's are linked and part of your application deployment. http://www.firebirdsql.org/
We are trying to deploy a demo version of a program, which uses a relational database.
However, we have an issue:
If we use SQL Server Express as a backend database server, then clients have to download the SQL Server Express install file, which is huge and not desirable.
So my question is: Is there any alternative way of deploying the demo database, and then get the application running at the client's side without SQL Server?
Thanks in advance.
Use SQL Server CE, it's only 1 dll (that you can distribute together with your application) and you can have your DB as a file.
Use Access.Access is a local light weight database.
I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx
I created a small application using C# winforms that uses SQL Server as a database.
Is there a way to attach the database to the exe file so I won't need to install SQL Server on all the machines that I want to run the program on?
As far as I know, that's where SQL Server Compact comes into play.
Quoting the Wikipedia article:
Unlike other editions of Microsoft SQL Server, SQL CE runs in-process with the application which is hosting it; while having a memory footprint of less than 2 MB;
in addition to sql server compact, there is also a c# port of sqlite that you could use.
Have you seen SQL Server Compact?
It's a Zero-config, single file version of SQL Server.
You can use SQL Server compact:
http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
or SQLite:
http://www.sqlite.org/
- it has a .NET library that you can download and use...it's pretty fast and compact
You can included it as part of the app installer. See this article