Jump to content
Xtreme .Net Talk

DanTheMan

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by DanTheMan

  1. Ok, here is the problem, this stored procedure is returning weird results. It will total the cart with tax sometimes, and then other times it won't. The biggest problem is the shipping, it isn't working right at all. It was working fine 3 days ago, although I would get an occasional error. Today it flat out stopped working. It is inputing 12.00 for shipping instead of 4.75. I am testing everything, but lately I have been inserting US for the country, and UT for the state. Also when I do the individual queries in the sql analyzer it returns everything just fine. I can't figure out where and why the results are being returned so different than my queries. I have spent at least 4 hours today looking it over trying everything I can think of. I am at a loss any help would be great. /* DBTotalCart Totals the shopping cart */ CREATE PROCEDURE aaa_TestTotal ( @UserID int, @Group int, @Active int, @OrderID int, @MasterID int ) As DECLARE @State varchar( 2 ) DECLARE @Country varchar( 2 ) DECLARE @Discount decimal( 3,2 ) DECLARE @OrderSubtotal money DECLARE @OrderTax money DECLARE @OrderShipping money DECLARE @OrderDiscount money DECLARE @ItemCount int DECLARE @ChargeShipping int SELECT @State = o.ship_state, @Country = o.ship_country FROM SC_MasterOrders AS m, SC_Orders AS o WHERE m.uid = @UserID AND m.i_recid = o.moid IF @Group <> 7 BEGIN UPDATE SC_Items SET discount = 0.00 WHERE oid = @OrderID END IF @Group = 7 AND @Active = 0 BEGIN UPDATE SC_Items SET discount = 0.00 WHERE oid = @OrderID END IF UPPER(@State) = 'UT' BEGIN SELECT @ItemCount = SUM(i.quantity), @OrderSubtotal = SUM(i.price * i.quantity), @OrderTax = SUM(((i.price - i.discount) * i.quantity) * 0.0625), @OrderDiscount = SUM(i.discount * i.quantity), @ChargeShipping = SUM(p.charge_shipping) FROM SC_Items AS i, CP_Inventory AS p WHERE i.oid = @OrderID AND i.pid = p.i_recid END ELSE BEGIN SELECT @ItemCount = SUM(i.quantity), @OrderSubtotal = SUM(i.price * i.quantity), @OrderTax = 0.00, @OrderDiscount = SUM(i.discount * i.quantity), @ChargeShipping = SUM(p.charge_shipping) FROM SC_Items AS i, CP_Inventory AS p WHERE i.oid = @OrderID AND i.pid = p.i_recid END IF @ChargeShipping > 0 BEGIN IF UPPER(@Country) = 'US' BEGIN IF @OrderSubtotal > 50.00 SELECT @OrderShipping = 0.00 ELSE SELECT @OrderShipping = 4.75 END ELSE BEGIN IF UPPER(@Country) = 'CA' BEGIN IF @ItemCount < 4 SELECT @OrderShipping = 5.75 IF @ItemCount > 3 AND @ItemCount < 7 SELECT @OrderShipping = 7.00 IF @ItemCount > 6 AND @ItemCount < 10 SELECT @OrderShipping = 9.00 IF @ItemCount > 9 SELECT @OrderShipping = 11.00 END IF UPPER(@Country) = 'MX' BEGIN IF @ItemCount < 4 SELECT @OrderShipping = 7.00 IF @ItemCount > 3 AND @ItemCount < 7 SELECT @OrderShipping = 9.00 IF @ItemCount > 6 AND @ItemCount < 10 SELECT @OrderShipping = 11.00 IF @ItemCount > 9 SELECT @OrderShipping = 15.00 END IF UPPER(@Country) <> 'CA' AND UPPER(@Country) <> 'MX' BEGIN IF @ItemCount < 4 SELECT @OrderShipping = 12.00 IF @ItemCount > 3 AND @ItemCount < 7 SELECT @OrderShipping = 15.00 IF @ItemCount > 6 AND @ItemCount < 10 SELECT @OrderShipping = 17.00 IF @ItemCount > 9 SELECT @OrderShipping = 20.00 END END END ELSE BEGIN SELECT @OrderShipping = 0.00 END UPDATE SC_Items SET moid = @MasterID WHERE oid = @OrderID UPDATE SC_Orders SET subtotal = @OrderSubtotal, tax = @OrderTax, shipping = @OrderShipping, total = (@OrderSubtotal + @OrderTax + @OrderShipping) WHERE i_recid = @OrderID UPDATE SC_MasterOrders SET discount = @OrderDiscount, subtotal = @OrderSubtotal, tax = @OrderTax, shipping = @OrderShipping, total = ((@OrderSubtotal + @OrderTax + @OrderShipping) - @OrderDiscount) WHERE i_recid = @MasterID GO
  2. Well, I found out what was wrong in case anyone is interested. It seems that the writeFile uses the virtual memmory. Our customers were downloading so many files that it was eating up all of our available virtual memmory and causing asp.net to shutdown. So, I had to call microsoft and get a tech on the phone to explain the problem. They are sending me a fix that will take care of the large file downloads. Here is a link to the article. http://support.microsoft.com/default.aspx?scid=kb;en-us;821387
  3. I modified the code Friday nigth before I left. To be honest with you I am not even sure that the response.write will work in the compiled code because I haven't been able to test it and really didn't care. :) Anyway it seems to have cured the problem, but then again I could be wrong. Now I am wondering if anyone knows why this portion of code that I wrapped into the try catch block would cough, and die? Also I was reading some other posts and noticed that response.redirects to other .aspx can cause this. Has anyone else heard of this happening? Public Shared Sub getFile(ByVal FilePath As String, Optional ByVal ContentType As String = "") If File.Exists(FilePath) Then Dim myFileInfo As FileInfo Dim FileSize As Long myFileInfo = New FileInfo(FilePath) FileSize = myFileInfo.Length HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearHeaders() HttpContext.Current.Response.ClearContent() Try HttpContext.Current.Response.AppendHeader("Content-Length", FileSize) HttpContext.Current.Response.ContentType = "application/octet-stream" HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & myFileInfo.Name) HttpContext.Current.Response.WriteFile(FilePath) HttpContext.Current.Response.End() Catch HttpContext.Current.Response.Write("Error Streaming File" & myFileInfo.Name) End Try End If End Sub
  4. I am having some trouble with downloads I offer on our website. Here is the setup: I have a directory called downloads which I have secured using IIS so that only admins and ASPNET user can access. With this setup no user can access the folder from the web unless they a. know the username and password of the admin b. validate through my asp.net application. The user authenticates and navigates to a page which displays all downloads they have access to. They click on the link and I run a sub routine that streams the file and allows them to download it. So here is the problem. We keep having problems with Server Application Unavailable. It is random and the only way to fix it is to reboot the box. I have been monitoring traffic through the website, and it isn't very high, and there is little strain on the box, so I cannot figure out what is happening. Also when I check the application log in the event viewer it gives me the error (aspnet_wp.exe (PID: ####) stopped unexpectedly). This is a huge deal for my company and I have no clue what is going on. Any help would be greatly appreciated. ------------HERE IS MY CODE--------------- Public Shared Sub getFile(ByVal FilePath As String, Optional ByVal ContentType As String = "") If File.Exists(FilePath) Then Dim myFileInfo As FileInfo Dim FileSize As Long myFileInfo = New FileInfo(FilePath) FileSize = myFileInfo.Length HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearHeaders() HttpContext.Current.Response.ClearContent() HttpContext.Current.Response.AppendHeader("Content-Length", FileSize) HttpContext.Current.Response.ContentType = "application/octet-stream" HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & myFileInfo.Name) HttpContext.Current.Response.WriteFile(FilePath) HttpContext.Current.Response.End() End If End Sub
  5. Ok heres the deal, my company sells a form of clipart online. They also have a clubsite where they give a certain amount of that clip art as part of the membership. I have an authentication system that works great right now, but there are some problems. I am using a landing page to determine which files they have access to and then I am placing a link that they can click that will open a subroutine in a code behind file that I wrote. The code behind file will then open the appropriate file and stream it to the browser. There are a couple of big problems with this method. The biggest is that it is not functioning in older versions of netscape and on Mac's. It has been a real headache to deal with all the crap that people are experiencing. The second problem we have is these lady's have DAP programs because they are on dial-up. The DAP's don't work without a direct link to the file. That won't work because I can't monitor or screen downloads. But these lady's are insisting that we give this feature to them because they want fast downloads. Also if the download is canceled or discounnected they can't be started where they left off, and they can be with the DAP's. This is a huge problem for me, and I have no idea where I could start looking for an answer. I have considered writing a piece that will create virtual directories into the folders of the files they have access to. This might work if I put the directory with the files outside of IIS. My big concern is what kind of performance issues will I have if I did it this way, also I am not even sure if I can create the virtual directories using .NET. I would really appreciate some insight from someone who has had some kind of similiar experience, or who might be able to shed some light on my dilema. Thanks
  6. I am having another problem. After referencing the .dll I just noticed that I lost a class. For some reason it sees all the classes except one. I am not sure if it renamed the class or what, but I can't register the new .dll and I haven't been able to figure out how I can view it in order to find out what happened to this class, any ideas?
  7. Finally got it figured out thanks guys.
  8. I apologize for being such a newb, I am not very familiar with Visual Studio.Net yet. So if I did something wrong let me know. I went into VS and opened up the OLE/COM Object Viewer and tried to bind the dll file. I recieved the following error, Bad Extension for File MK_E_INVALIDEXTENSION($800401E6). What am I doing wrong? Am I even close to what you suggested?
  9. Hey I got a comm object for a Valentina DB. I don't have the library header files and so I can't import the dll into ASP.Net. I got around that by calling server.createobject. Below is a snippet of code I am having trouble with. For intCounter = 1 to vCursor.RecordCount vField = vCursor.Field( intCounter ) strReturn = strReturn & vField.Value & "<br>" vCursor.NextRecord() Next The big problem is I cannot assign a dynamic value to the Object vCursor.Field(). It keeps kicking out the error (System.Runtime.InteropServices.COMException: Field not found). Could this be an issue involving the order of processing? Its almost as if the object is being executed before a value is being assigned to intCounter, but I thought it executed line by line. I am totally stumped, I am hoping someone who has more experience using comm objects inside of asp.net will have a better idea. Also as a side note, this object was actually written for PHP.
×
×
  • Create New...