开发者

Expose existing Oracle Business/ DBLayer to Silverlight

We have an an existing Business Layer that talks to an oracle DB Layer. All the procedures returns a DataTable. Since Silverlight does not support DataTables, I am not sure what is the easiest way of exposing the business Layer.

I would rather not re-write the business layer. I开发者_JS百科s there some way to convert the datatable to something usable in SilverLight. That way I can just expose whatever methods in my business layer I need for the SilverLight app in a WCF Service

Thanks,

John


DataTables aren't a great fit for a data transfer object format, for precisely the reason that you mention, and they're being phased out in favor of things like the Entity Framework. The ADO.NET team posted a blog that discussed this precise problem here.

As other folks have mentioned, if you don't want to change your business layer, one option is to write an intermediate layer that converts the DataTable either to a reasonable XML or JSON format, or to a series of classes that can then be serialized into either XML or JSON.

But another that you should investigate is the SilverlightDataSet project hosted here, which supposedly gives Silverlight the ability to consume DataSet objects that have been serialized to XML. Haven't tested it myself, but it sounds like it's worth investigating.


The most flexible way is to implement web services on the middle tier that call the existing business methods and then converts them to XML or JSON. Once that's done pretty much anything can use them.


Thanks for the responses. I ended up using a dataset from Telerik which is the controls I have been using. http://forums.silverlight.net/forums/p/16733/69252.aspx

In the future, when building a business layer, what is recommended as the return type of data. Keep in mind we use Oracle here. Does it make sense to keep them as a datatable and have the intermediate layer that converts the DataTable

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜