Silverlight SQL Deployment - database

I'm about to write an application in either Adobe Air or Silverlight, to run standalone, offline, on the desktop. It's a simple enough application that allows the user to enter text data and will then print formatted documents based on that information. The obvious place to store all this relational data is in a database. I believe Air comes with SQLite out of the box, so no problems there, but from what I can tell Silverlight doesn't. How does Silverlight handle installing an out of browser application that needs to access a local database? Does the user have to install SQL/SQLite first and then Silverlight, or is there some way that Silverlight can deploy that side of things itself?
Thanks

I don't know much about Air, But Silverlight has IsolatedStorage for saving data on client-end and it has its own constrains. But if you want to have an application that can access local database why don't you try WPF(XBAP)?
This link can be helpful regarding SQLLite and Silverlight using IsolatedStorage.
http://forums.silverlight.net/forums/p/118411/267135.aspx
Regards.

I'm fairly certain silverlight isn't intended for... whatever it is you're trying to do.

Related

Need some suggestions for developing a desktop application that uses offline database

I have a web application that needs to be implemented as a desktop application. With my brief research about it, I came to know about Electron. Though it is an amazing tool to convert web applications to desktop ones, my application needs a database to run and it needs to be run offline. I also did read about using SQLite. I need to get more insight and suggestions as to how I should proceed with it.
Well if you are going to use SQLite don't to forget to encrypt the database.
To learn more about it check this

Silverlight 4 with SQLite or alternative

I am making a Silverlight app and what I considered something straight-forward really isn't.
I am in need to create a application where a local database is stored on the web server where the Silverlight application can connect to and whenever a user goes on the application will allow sql queries to be carried out. Main use is Registration, login and event registration.
I have tried the Community SQLite: http://code.google.com/p/csharp-sqlite/
But had trouble getting it to work with Silverlight, my guess is due to poor documentation. I already have made a project containing a lot of work so I just want to implement my SQLite code into that.
Can anyone help
Thanks.
If you want your Silverlight application to have a LOCAL storage database, check out Sterling.
If you want your Silverlight application to query a centralized, server-side database, then you need to expose your database via WCF. RIA services is probably the easiest implementation.

What are the big major drawbacks porting a wpf LOB to silverlight 4

I am thinking about porting my alpha WPF MVVM application to silverlight.
I do not use 3D its a LOB ;-)
What I promise myself from the conversion is to get more customers in the end (Mac/nix user do not pay well ;P).
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
2.) Is there anything concerning MVVM silverlight can not handle?
3.) Does SEO work well with Silverlight 4?
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
If you want to use a local database then you'll either need to install your Silverlight application on the local machine as a full trust application or use a database that installs into Isolated Storage like SiaqoDb (as suggested by #Shawn Mclean). You won't be able to access a USB stick.
When run in a browser across the net it has limited access to the local hard drive for security reasons. If you're doing this you might as well stick with WPF.
2.) Is there anything concerning MVVM silverlight can not handle?
You can use Prism to develop MVVM applications for Silverlight as well as WPF.
3.) Does SEO work well with Silverlight 4?
I don't know a great deal about this, but Silverlight can be viewed as Microsoft's version of Flash so it will probably have the same SEO issues as Flash. The code is compiled and delivered to the client in binary form, so unless you split your application across multiple HTML/ASP.NET pages there won't be anything for Google to index. Apparently Flash does support SEO, but I haven't looked into SEO and Silverlight.
1.) At the moment I am using sqlite as database. Is it possible, that I can access the sqlite file on the harddisk of my user to read/save data? (on User dir its possible but access an USB stick ?)
The basic principal of Silverlight is centralised data over services. You can have local data, but that is not as useful generally compared to a central storage. You then have no worries about full trust as it will run in any Silverlight browser.
You can use SQLLite on your server, however the best free database option we have found is SQL Service Express 2008 R2.
You can access USB, but it requires both OOB, Full Trust and a custom COM automation object installed on the client (so Windows only). Basically forget local USB storage and support downloads instead, if local copies are needed.
2.) Is there anything concerning MVVM silverlight can not handle?
Bindings in Silverlight 4 are now very similar to those in WFP. Accessing parent elements from templates is a little more difficult, but most simple bindings are the same.
3.) Does SEO work well with Silverlight 4?
First ensure that you provide a sitemap for the searchengines. That should map to all content pages.
Provide a parallel ASP.Net website to publish your content for the search engines to read. This is now quite easy with RIA services as an ASP.Net website can consume a RIA service just like any other WCF service.
Make good use of headers, meta tags, titles, human-readable urls to include relevant keywords.

Does Silverlight 3 have access to local file system, Open Excel, and print reports?

I was wondering if Silverlight 3 can be used to create line of business applications where I can use file import/export facilities, read an xls file and open Excel, use a report tool like Crsytal Reports or Reporting Services or.. is WPF needed?
I am new to Silverlight and WPF and want to decide if I can skip learning WPF. I know Silverlight is a subset of WPF but I just want to concentrate in one of the two.
Although Silverlight is sand-boxed and it isn't possible to open and save files to the local file system direcly, it is possible to get a stream to a local file.
There are the OpenFileDialog and SaveFileDialog classes. These classes make it possible to let the user select a file or location. They return only a stream to that file and do not give any information about the filesystem. This way it's possible to import and export to excel for example.
This example should be enough to get you going.
update:
in the meantime I did a small SilverBullet(tm) on the subject on my blog at http://www.timmykokke.com/
Silverlight 3 has quite limited file system access. Even though you can save a local file you cannot open it using the associated application directly from Silverlight. If you want the user to export and open an Excel file from a button click in Silverlight you will have to consider alternatives:
You can open a new browser window pointed at a URL on your webserver that generates an Excel file. If the server sets the correct content type and the client is properly configured the user will be prompted to open the file in Excel. This effectively moves your export code to the server.
You can embed an ActiveX control on the same page as the Silverlight control and using the browser object you can operate this ActiveX control from Silverlight. Given enough rights by the user the ActiveX control can do anything to the local computer including automating Excel.
No, but apparently SL4 does!
Local file access - Silverlight 4
No, but unlike Jimmy my guess is that it won't happen in a future.
If you need local system there are other technologies to use (e.g. local windows service which can communicate with silverlight app).
The reason why silverlight won't have local access in the nearest future is that Microsoft learned it's lesson with ActiveX.
No, as far as I know Silverlight 3 is still as sand-boxed as ever. This is becoming a bottleneck for developers though, so I'm sure it will be addressed in upcoming versions of Silverlight.
From what I know, SL3 doenst support to use COM application such as Word, Excel, etc.. but SL4 does. If your application is just gonna be used internally, WPF will be the best candidate for your project, but if you want it to be used from the external clients as well, then I reckon you can use SL4, then use OUT OF BROWSER, then it'll work really similar with WPF. Plus with SL4, you're able to interact with Excel, Word, etc... to do lots of things.
Cheers,
Brandon

Data access technology for Silverlight and WPF standalone app versions

I am writing an applicaton that will be a standalone WPF application and also a cut down version that will work as Silverlight and so be hosted in browsers. I want the Silverlight application to access data from the cloud. The WPF application needs to work against a local database but then be able to sync with the same cloud storage.
So I need the following scenarios to work. Silverlight works directly against the data stored in the cloud. The WPF app works against a local database. But the WPF app has the ability when it starts up to go to the cloud and get the latest version in case of changes being made online since the last time the WPF app was run. When the user finishes on the WPF app it can then sync up the changes made to the cloud again. This allows better performance during WPF being run and also allows you to run it offline and sync up later when you have a connection.
What is the best technology available to do this? I know there is a Sync Framework, SQL Server Data Service, ADO.NET Entity Framework and SQL Server Compact Edition that help with data access but I am not sure if they can be made to work together to do the presented scenario.
Do I implement all this myself? Does most of it come for free and I only need to handle the syncing? If you have deep knowledge of the Microsoft data access technologies then I would appreciate your input on the design.
Your scenario would be easy with a standard SQL server backend. :)
However, I think what you're proposing is doable for the most part. For the WPF app and syncing to the cloud with SSDS you could use Project Huron (which has downloads coming "soon"). That would keep your SSDS data in sync with the WPF client apps.
For the silverlight side you could use the REST api of SSDS (or a helper library like SSDS Rest).
So you won't need to implement most of it yourself, but whenever you head down a road like this one there are always lots of little roadblocks to run into along the way. Have fun!

Resources