Skip to main content
Home Forums General Silverlight Hosting and Streaming Accessing SQL database without web services
3 replies. Latest Post by vitor_canova on December 29, 2008.
(0)
OsoreWat...
Member
1 points
2 Posts
12-29-2008 10:14 AM |
Hello,
I have been searching for a solution but I am not able to find one during the last week.
I am looking to retrieve data from a SQL database like I am used to in the Windows Forms environment. I do have found several posts about connecting to a database through web services, unfortunately my host does not provide this ability (yet). Though I would like to connect to databases.
So my question is: is it possible to gain access to a SQL database without any form of web services (WCF)? More like a direct connection within the Silverlight assembly...
I thank you in advance.
party42
Participant
1102 points
338 Posts
12-29-2008 10:48 AM |
Nope you cant. Silverlight runs in the client. SqlServer runst on the server. There are some client side databases available but this would mean a huge impact on local storage.
You can use localstorage as your database solution (ie streaming / serializing the objects to disk). But obviously, you would miss out on all the advantages of a SQL solution.
12-29-2008 11:01 AM |
That is a feature I will be missing a lot then. Another feature something similar would be great, even if you just have to fire SQL Queries by yourself.
Indeed the streaming/serializing is not an option at all and will cause way too much overhead.
Is it possible instead to send data to a page which results in some XML which then can be parsed?More like: www.mywebsite.com/GetInfo.asxp?ID=1234 and that the page uses this ID and generates some elements which can then be readed by the Silverlight Application, like:<info> <name> <first>Osore</first> <last>Watashi</last> </name> <country>Netherlands</country> <language>Dutch</region> <region>Europe</region></info>
The parsing should not be any problem, as long as it is possible to get this data in some form back, like XML.
I thank you again in advance.
vitor_ca...
152 points
41 Posts
12-29-2008 6:05 PM |
If you want to call www.mywebsite.com/GetInfo.aspx?ID=1234 you can use WebClient and return a XML, but it is like reinvent the wheel. Because WebService (WCF) return XML that is parsed. I don't see advantage to access with aspx page. But, if you really want to do this, create a ashx.