Skip to main content

Microsoft Silverlight

Answered Question Accessing SQL database without web servicesRSS Feed

(0)

OsoreWatashi
OsoreWat...

Member

Member

1 points

2 Posts

Accessing SQL database without web services

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
party42

Participant

Participant

1102 points

338 Posts

Answered Question

Re: Accessing SQL database without web services

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.

Regards,
Nathan Brouwer

http://www.nathanbrouwer.nl

OsoreWatashi
OsoreWat...

Member

Member

1 points

2 Posts

Re: Accessing SQL database without web services

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_canova
vitor_ca...

Member

Member

152 points

41 Posts

Re: Accessing SQL database without web services

 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.

The post helped you? mark as answered

Vitor Canova Weingaertner
Go to my blog
Go to my Site
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities