I'm using a shared host to run a modified version of The Beer House e-commerce module (using
www.DiscountASP.NET) However, they (and most shared hosts) don't support Distributed Transaction Processing, which The Beer House uses. So I get this error when trying to submit an order to PayPal:
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
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;
"Due to security concerns, I'm afraid that we will not be able to provide access to the Microsoft Distributed Transaction Coordinator. If your application requires transactions, ASP.NET web transactions are not supported, however, you can use the SQL Transaction
class as an alternative as a workaround."
So does anyone know how I would convert to using the SQL Transaction class? Or does anyone know of a host that supports shared Distributed Transaction Processing? I would hate to scrap all of the work I've done.
This is the code that comes up in the debugger:
public
override int InsertOrderItem(OrderItemDetails orderItem)
{
using (SqlConnection cn =
new SqlConnection(this.ConnectionString))
{
SqlCommand cmd =
new SqlCommand("tbh_Store_InsertOrderItem", cn);
I assure you that none of TheBeerHouse code uses the MSDTC, so that's not your issue.
The application indeed uses transactions, but they are all local transactions, not distributed.
If you examine your error, you'll note that it has nothing to do with the transaction anyway. The application is not letting the ASP.NET request identity open your connection. That is a permissions issue. So, that's where you need to be looking.
Thanks. I ended up switching to a new host that supports MSDTC, and it works now. Not sure if was exactly that, or a permissions issue like you said, but it works now. By the way, the host is
www.appliedi.net is you're looking for a host that supports distributed transactions. Their support people helped me get this up and running... so far so good.
Actualy if you just install the Beerhouse starter kit and ryn it and go thru the entire process of checking out an item, the nwhen it is supposed to go to paypal it DOES use MSDTC
I haven't gone through the e-Commerce chapter yet of the book but I'm wondering what does it take to use PayPal? Do I need a merchant account with PayPal? Are there special PayPal scripts I need to install in my site? Are there any fees for using PayPal
? Thanks
For testing purposes, you just need to sign up for a developer sandbox account, which is totally free. For a live site that would involve collecting "real" money, you would need a PayPal merchant account. The fees for that are detailed on their web site.
I am so confused, some say yes and some say no. Does or does not thebeerhouse use MSDTC, which would disquality it from being used on
www.discountasp.net?
digital_crea...
Member
3 Points
5 Posts
Can't use e-commerce module in shared hosting-please advise!
Apr 26, 2008 10:21 PM|LINK
I'm using a shared host to run a modified version of The Beer House e-commerce module (using www.DiscountASP.NET) However, they (and most shared hosts) don't support Distributed Transaction Processing, which The Beer House uses. So I get this error when trying to submit an order to PayPal:
I got the following message back from my host:
"Due to security concerns, I'm afraid that we will not be able to provide access to the Microsoft Distributed Transaction Coordinator. If your application requires transactions, ASP.NET web transactions are not supported, however, you can use the SQL Transaction class as an alternative as a workaround."
So does anyone know how I would convert to using the SQL Transaction class? Or does anyone know of a host that supports shared Distributed Transaction Processing? I would hate to scrap all of the work I've done.
This is the code that comes up in the debugger:
public override int InsertOrderItem(OrderItemDetails orderItem){
using (SqlConnection cn = new SqlConnection(this.ConnectionString)){
SqlCommand cmd = new SqlCommand("tbh_Store_InsertOrderItem", cn);cmd.CommandType =
CommandType.StoredProcedure; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = orderItem.AddedDate;cmd.Parameters.Add(
"@AddedBy", SqlDbType.NVarChar).Value = orderItem.AddedBy; cmd.Parameters.Add("@OrderID", SqlDbType.Int).Value = orderItem.OrderID;cmd.Parameters.Add(
"@ProductID", SqlDbType.Int).Value = orderItem.ProductID; cmd.Parameters.Add("@Title", SqlDbType.NVarChar).Value = orderItem.Title;cmd.Parameters.Add(
"@SKU", SqlDbType.NVarChar).Value = orderItem.SKU; cmd.Parameters.Add("@UnitPrice", SqlDbType.Money).Value = orderItem.UnitPrice;cmd.Parameters.Add(
"@Quantity", SqlDbType.Int).Value = orderItem.Quantity; cmd.Parameters.Add("@OrderItemID", SqlDbType.Int).Direction = ParameterDirection.Output;cn.Open(); //This is where the error occurs
int ret = ExecuteNonQuery(cmd);return (int)cmd.Parameters["@OrderItemID"].Value;}
}
Thanks!
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
Apr 27, 2008 07:24 PM|LINK
I assure you that none of TheBeerHouse code uses the MSDTC, so that's not your issue.
The application indeed uses transactions, but they are all local transactions, not distributed.
If you examine your error, you'll note that it has nothing to do with the transaction anyway. The application is not letting the ASP.NET request identity open your connection. That is a permissions issue. So, that's where you need to be looking.
Follow Me on Twitter
digital_crea...
Member
3 Points
5 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
Apr 28, 2008 02:37 AM|LINK
Thanks. I ended up switching to a new host that supports MSDTC, and it works now. Not sure if was exactly that, or a permissions issue like you said, but it works now. By the way, the host is www.appliedi.net is you're looking for a host that supports distributed transactions. Their support people helped me get this up and running... so far so good.
bcweed966
Member
261 Points
893 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
May 23, 2008 10:27 PM|LINK
Actualy if you just install the Beerhouse starter kit and ryn it and go thru the entire process of checking out an item, the nwhen it is supposed to go to paypal it DOES use MSDTC
Annddrew
Member
237 Points
85 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
May 26, 2008 02:05 PM|LINK
Hi,
I haven't gone through the e-Commerce chapter yet of the book but I'm wondering what does it take to use PayPal? Do I need a merchant account with PayPal? Are there special PayPal scripts I need to install in my site? Are there any fees for using PayPal ? Thanks
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
May 26, 2008 02:14 PM|LINK
For testing purposes, you just need to sign up for a developer sandbox account, which is totally free. For a live site that would involve collecting "real" money, you would need a PayPal merchant account. The fees for that are detailed on their web site.
Follow Me on Twitter
VeganMan
Member
82 Points
138 Posts
Re: Can't use e-commerce module in shared hosting-please advise!
Mar 30, 2011 04:22 AM|LINK
I am so confused, some say yes and some say no. Does or does not thebeerhouse use MSDTC, which would disquality it from being used on www.discountasp.net?