 |
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0  | This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

November 19th, 2006, 11:41 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
DB access denied, but only SqlStoreProvider.cs
When attempting to submit an order to PayPalSandbox from my remote server, I get Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). By enabling trace = "true" in ShoppingCart.aspx, I see it blows up at line 660 "cn.Open" in SqlStoreProvider.
The weird thing is, I use the same connection string that's in web.config, and it works fine everywhere else.
My host doesn't allow remote debugging.
I'm not having any other database access issues with my remote site.
Has anybody had this type of problem? Any ideas are appreciated.
|
|

November 19th, 2006, 07:11 PM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here's a few more details of the error message.
Exception Details: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Source Error:
Line 658: cmd.Parameters.Add("@Quantity", SqlDbType.Int).Value = orderItem.Quantity;
Line 659: cmd.Parameters.Add("@OrderItemID", SqlDbType.Int).Direction = ParameterDirection.Output;
Line 660: cn.Open();
Line 661: int ret = ExecuteNonQuery(cmd);
Line 662: return (int)cmd.Parameters["@OrderItemID"].Value;
Source File: e:\web\ewdtestsite\htdocs\App_Code\DAL\SqlClient\S qlStoreProvider.cs Line: 660
I'll go thru the stack trace to see if I can make any sense of it. I haven't touched any permissions on any of the tables.
Maybe my host just needs to restart their servers?
|
|

November 21st, 2006, 10:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I use a third-party hosted server and I like to log to a file that I can download via ftp (but don't give the log file an obvious name). Or you can log via webevents. You should insert log entries to show the items around this code: the connection string and sql.
You could save time by debugging it on your own computer where you can step through it in the debugger.
|
|

November 22nd, 2006, 08:53 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I contacted my host and they ran a test and sent me the results:
"We ran a file monitor while submitting the order. Your application is trying to access the c:\windows\system32\xolehlp.dll file. This is use in distributed transactions (MSDTC), which we do not support. Perhaps certain parameters in your database connection results in using a distributed transaction."
I suppost the culprit is line 354 of Order.cs:
"using (TransactionScope scope = new TransactionScope())"
So they don't support this type of transaction. I commented it out, while debugging, until I can come up with another transaction method. Now, it blows up at line 95 of ShoppingCart.aspx.cs, since it can't return the Order object, even though it is in the DB.
I'm not having any of these problems when I debug on my own computer. Maybe it's something the host doesn't support.
|
|

November 22nd, 2006, 10:47 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
When I had the error I tracked in down to the Distributed Transaction Coordinator service on my server. Once I started that all was well. Granted, we have our own server so I don't how much help it will be if you host outside.
SL
|
|

November 22nd, 2006, 12:38 PM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
|
|
You can emulate your hosts error by turning off the MSDTS server.
|
|

November 23rd, 2006, 11:26 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay it runs now, takes me to PayPal Sandbox, I make the payment, and I return to my website. My tbh_OrderStatuses table was empty  .
I still need to come up with a transaction method that my host (DiscountASP.net) supports, since my "using (TransactionScope scope = new TransactionScope())" block is commented out....
|
|

November 24th, 2006, 07:53 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi ewelling ,
i'm hosting on DiscountASP too and facing the same problem , how did you overcome it , my tbh_orderstatuses are not empty though still getting the MSDTC error .
many thanks in advace :)
|
|

November 24th, 2006, 10:31 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Read my post on 11/22 about attempting to access a xolehlp.dll file and DiscountASP not supporting distributed transactions. I assumed the "using TransactionScope scope = new TransactionScope()" statment in BLL/Store/Order.cs was the culprit.
I commented that block out and tried it then, and after fixing my tbl_OrderStatuses table, everything works fine through PayPal Sandbox.
Still needing a transaction method, I then used SWC as described in Marco's book starting on p.71. So far this is working fine for me. Be sure to add "using System.EnterpriseServices;". ASP.NET didn't like the "svcConfig.Transaction = TransactionOptions.RequiresNew;" statement, though.
-Ed
|
|

December 6th, 2006, 08:35 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi ewelling,
I cannot understand how to use the SWC feature with reference to hosting it on a Windows 2003 server.
Is it possible to show were I should insert the SWC routine.
thanks
Steve2000
|
|
 |