Error in accessing data using ADO.Net data service
- 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.
- Změněný typPrashant Phalle 2. července 2009 13:29
- Změněný typPrashant Phalle 3. července 2009 7:06
Odpovědi
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.- Označen jako odpověďPrashant Phalle 3. července 2009 7:07
- Označen jako odpověďPrashant Phalle 30. června 2009 4:32
Všechny reakce
- 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. - 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.- UpravenýPrashant Phalle 26. června 2009 8:49
- UpravenýPrashant Phalle 26. června 2009 7:57
- 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. 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- 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. - Hi Stephane,
Can you please give me pointers on publishing that ADO.net service on service bus?
Thanks,
Prashant. 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.- Označen jako odpověďPrashant Phalle 3. července 2009 7:07
- Označen jako odpověďPrashant Phalle 30. června 2009 4:32
- 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.
- Might be an error in the article, IRequestHandler is defined in System.Data.Services
- 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.
- UpravenýPrashant Phalle 29. června 2009 14:03

