Microsoft Developer Network > Página Inicial dos Fóruns > AppFabric > Error in accessing data using ADO.Net data service
Fazer uma PerguntaFazer uma Pergunta
 

RespondidoError in accessing data using ADO.Net data service

  • quinta-feira, 25 de junho de 2009 12:38Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.


Respostas

Todas as Respostas

  • sexta-feira, 26 de junho de 2009 5:59Yi-Lun LuoMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • sexta-feira, 26 de junho de 2009 7:54Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • sexta-feira, 26 de junho de 2009 7:56Yi-Lun LuoMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • sexta-feira, 26 de junho de 2009 10:47Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    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

  • domingo, 28 de junho de 2009 14:18Stephane GUNET Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • segunda-feira, 29 de junho de 2009 6:49Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi Stephane,

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

    Thanks,
    Prashant.
  • segunda-feira, 29 de junho de 2009 7:55Stephane GUNET Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido

    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.

  • segunda-feira, 29 de junho de 2009 9:18Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.


  • segunda-feira, 29 de junho de 2009 9:52Stephane GUNET Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Might be an error in the article, IRequestHandler is defined in System.Data.Services
  • segunda-feira, 29 de junho de 2009 13:43Prashant Phalle Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.