I'm developing an application on a Windows CE Platform and this application need a connection to a remote database (Sybase ASE). This remote database is on the internal network.
How can I do this?
It seems that ODBC isn't embedded in the Compact Framework...
The only one solution that I found was to develop an UNIX application that executes my SQL code and send it back to my C# application (using Socket...).
Better idea?
Thanks !
If you have access to IIS, you could create a web service and call that from your Windows CE application. This I think would be cleaner than anything you would do with raw sockets.
I don't know this for a fact, but it is very possible that the DataTable instance could be serialized and a lot of the parsing work would be done for you.
Your web method might be something like this:
DataTable ExecuteQuery(string query);
You might be able to use the ASE ADO.NET Data Provider. I believe it does work with the Compact Framework.
Just curious; doesn't Connecting to an ASA database on Windows CE documentation provide guidance for doing this on Windows CE?
Related
I'm trying to update my Windows Phone app from using Silverlight to Windows Runtime so as to use the new universal application approach.
There's a huge problem though: in Silverlight there is integrated support for SQL Server CE through System.Data.Linq. I like it very much, but apparently this code is not available in Windows Runtime. Actually, there appears to be no native support for any kind of database in WinRT, but people are happy using the sqlite-net NuGet package for this purpose.
So, even if I used sqlite-net, there's still a problem - users will already have the data in SQL Server CE format when the app is updated - how then am I going to convert the data from SQL Server CE to SQLite so that I would be able to access it in Windows Runtime?
It is not possible to do this on a device, so you must move the SQL CE database elsewhere for conversion to sqlite, and the get hold of the converted database and put it back on the device. Some kind of web service should be able to do this non-trivial task.
I created a C# application that uses .mdf database and it works perfectly on my PC.
Now i wanted to install that application on network PCs that can connect to a single database and use that data.
I tried changing the connection string in application with only changing file path, but it doesn't work. How can i use one PC as server and use program as client application that can connect over network. How do i set up SQL server on that PC, and should i do that? How is this done? I couldn't find any tutorial so far...
Could someone help me a bit.
I don't think you should be doing this, this is something that I once looked into myself. I once used a standard base unit for this same purpose and although it worked fine your not really supposed to do it.
You have to ask yourself how important the application is to the business. If its critical then this would be a real bad move for a couple of reasons :-
1) What happens if base unit hosting SQL Server dies? or is switched
off. Your unstuck.
2) You will only be able to schedule backups of the
SQL Server Database on the local hard disk . If the Disk dies then you
will lose everything.
When all is said and done, for the scenario that you are presenting, a MS Access database is probably a cleaner way to go. Access databases, albeit dated, can be hosted on a shared network space and can be accessed by multiple users. ADO.NET is nt too bad and you can still use LINQ with Data Tables etc.
What your looking into doing in your description wont really be fruitful unless your hosting the SQL Server on an Actual Server, as its designed for.
Some people suggest using using SQL Compact, but that itself is designed only to run from a local machine.
Hope this Helps.
#Milan: Go to the SQL Server configuration manager and enable TCP/IP service for SQL Server. As sql server uses TCP/IP for communication.
This link will help you.
http://kristofmattei.be/2010/06/21/enabling-sql-server-2008-r2-access-over-network/
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 have one WinForm Application which using MS-SQL server As Database.
now off course Database i have created on my PC(Developer's PC) is not available on Client PC where i will install my Application.
Then what is the best criteria or practice to Add Database at Client PC's MS-SQL server.
So i can access it my Application.
Please Help....
Thanks.......
Depending on the actually size of the database, I would suggest you use SQL Conpact provider as you won't then need to worry about the whole setup process of installing SQL Server.
Good article to get started using Sql Compact
First you need to ensure that MSSql server is installed in the Clients PC. Assuming you have that taken care of, you could add Custom actions during installations which would execute the script to install the Database on the Client machine.
The exact way to do that of course depends on how you are creating the Installer Program.
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