Microsoft 开发人员网络 > 论坛主页 > AppFabric > Error in accessing data using ADO.Net data service
提出问题提出问题
 

已答复Error in accessing data using ADO.Net data service

  • 2009年6月25日 12:38Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi
    By watching the How to video for ADO.Net data service by Mike Flasko http://msdn.microsoft.com/en-us/data/cc745957.aspx
    I created a data accessing service grsDataService.svc in webrole. I am able to access the names of all tables in DB but not the actual table data as shown in video. I can do it very well in dev fabric. But not in that deployed on cloud, http://4758809a77084a18bd0ec1ac6b4a1ff9.cloudapp.net/grsDataService.svc/
    And to access the particular table data -
    http://4758809a77084a18bd0ec1ac6b4a1ff9.cloudapp.net/grsDataService.svc/tblAction
     
    Do I missed something ?
     
    Thanks,
    Prashant.


答案

全部回复

  • 2009年6月26日 5:59Yi-Lun LuoMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hello, please add the following attribute on your service class, and you'll be able to see the detailed error message.

    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]

    By the way, what is your data source? Is it Azure Table Storage or a database? If the data source comes from a database, it will not work in Windows Azure because currently we do not support database.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2009年6月26日 7:54Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi Luo,

    I am accessing my local SQL DB through ADO.Net service. I can access it using an application at devlopment fabric but not at same deployed on cloud. On cloud I get table list only. >>
    http://8128041e2eb44b64bc04542092b0e188.cloudapp.net/grsdataservice.svc/

    And for particular table >> http://8128041e2eb44b64bc04542092b0e188.cloudapp.net/grsdataservice.svc/tblAction/
    I gives error --

    In Mozila I get  >> An error occurred while processing this request
    and in IE >> HTTP 500 Internal Server Error

    The attribute you suggested did not help to get detailed error message. :(
    If it does not support how it give me the list of tables in my local DB ?

    Thanks,
    Prashant.
  • 2009年6月26日 7:56Yi-Lun LuoMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    The cloud machines don't have SQL Server installed. So you cannot use database. Please use Azure table storage instead.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2009年6月26日 10:47Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    This is the stacktrace --

    "   at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, Uri requestUri)\r\n   at System.Data.Services.Client.DataServiceQuery`1.Execute()\r\n   at System.Data.Services.Client.DataServiceQuery`1.GetEnumerator()\r\n   at SqlDataService_WebRole._Default.Page_Load(Object sender, EventArgs e) in f:\\AZURE\\My Samples\\SqlDataService\\SqlDataService_WebRole\\Default.aspx.cs:line 26\r\n   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n   at System.Web.UI.Control.OnLoad(EventArgs e)\r\n   at System.Web.UI.Control.LoadRecursive()\r\n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

    And error message -- An error occured while processing request.


    Thanks,
    prashant

  • 2009年6月28日 14:18Stephane GUNET 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    The server in the cloud cannot access your database. It knows the table structure because it is stored in your ADO.NET Data Service (probably in an .edmx file), but it cannot retrieve the data, which is stored on your local machine, unless you open your firewall to allow access to your SQL Server from the internet (and have a fixed IP address).

    If you want to publish a database hosted on your machine, you would have to host the ADO.NET Data Service on your machine, and publish it using the Service Bus.
  • 2009年6月29日 6:49Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi Stephane,

    Can you please give me pointers on publishing that ADO.net service on service bus?

    Thanks,
    Prashant.
  • 2009年6月29日 7:55Stephane GUNET 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

    I might have been a bit hasty in suggesting this solution, since I've never done it myself, but I found this post by Christian Weyer which is probably a good starting point :
    http://blogs.thinktecture.com/cweyer/archive/2007/12/11/415057.aspx
    If you use webHttpRelayBinding, and specify the necessary credentials before opening the host, that should (hopefully...) do the trick.

  • 2009年6月29日 9:18Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Thanks for reply Stephane,

    I am not able to find the DLL Microsoft.Data.Web which is required by the samples in your link.  :(



    Prashant.


  • 2009年6月29日 9:52Stephane GUNET 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Might be an error in the article, IRequestHandler is defined in System.Data.Services
  • 2009年6月29日 13:43Prashant Phalle 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi Stephane,
    Thanks a lot for providing the link.
    I worked on it.
    I am able to share my SQL data thru service bus. :)

    Thanks,
    Prashant.