Results 1 to 25 of 25

Thread: [2008] 2 if

Threaded View

  1. #1

    Thread Starter
    Frenzied Member met0555's Avatar
    Join Date
    Jul 2006
    Posts
    1,385

    [2008] 2 if

    Hi,

    sorry I'm posting too much these times, but i need it to be fixed. i will do my best to follow this advice, maybe it's true. http://www.vbforums.com/showpost.php...46&postcount=6
    thanks mendhack

    Hi,
    Well, now I have the same kind of code 2 times, but the 2nd one is not working. It was supposed to redirect to another page, but it'snot running the code i wrote until the end.
    When irun the debug , it stops after this Do While reader2.Read()
    Where could be the problem?


    vb Code:
    1. Dim Accesstring As String = ("SELECT     FirstName, LastName, Email, StreetAddress, City, Country, State, Zip, Worknum, googlecheckout, paypal, csftcc, confirmationcode, paymentamount FROM dbo.reservation WHERE (confirmationcode = @concode)")
    2.             Dim cmd3 As New SqlCommand(Accesstring, icnnn)
    3.             cmd3.Parameters.Add("@concode", SqlDbType.NChar).Value = onlineconfirmationcode.Text
    4.  
    5.  
    6.             Dim reader As SqlDataReader = cmd3.ExecuteReader
    7.  
    8.             '/paynow.html
    9.  
    10.  
    11.             While reader.Read()
    12.                 afirstname = reader("FirstName").ToString()
    13.                 alastname = reader("LastName").ToString()
    14.                 aemail = reader("Email").ToString()
    15.                 aadress = reader("StreetAddress").ToString()
    16.                 acountry = reader("Country").ToString()
    17.                 acity = reader("City").ToString()
    18.                 astate = reader("State").ToString()
    19.                 azip = reader("Zip").ToString()
    20.                 aworknum = reader("Worknum").ToString()
    21.                 agooglecheckout = reader("googlecheckout").ToString
    22.                 apaypal = reader("paypal").ToString()
    23.                 acsftcc = reader("csftcc").ToString()
    24.                 aconfirmationcode = reader("confirmationcode").ToString()
    25.                 apaymentamount = reader("paymentamount").ToString()
    26.  
    27.  
    28.  
    29.  
    30.             End While
    31.  
    32.  
    33.             reader.Close()
    34.             '-------------------------------------------------
    35.  
    36.  
    37.             '----retrive payment link------------
    38.             Dim Accesstring2 As String = ("SELECT     paymentamount, googlepaymentlink, paypalpaymentlink FROM settingss WHERE (paymentamount = N'" & apaymentamount & " ')")
    39.             Dim writer As IO.TextWriter = New IO.StreamWriter("/paynoww.html")
    40.             Dim cmd32 As New SqlCommand(Accesstring2, icnnn)
    41.             Dim reader2 As SqlDataReader = cmd32.ExecuteReader
    42.             Dim abcd As String
    43.  
    44.  
    45.             '------For google checkout payment-----------------------------------------------------------------
    46.             If agooglecheckout.Trim = "True" Then
    47.  
    48.          
    49.                 Do While reader2.Read()
    50.                     apaymentlink = reader2("googlepaymentlink").ToString()
    51.                     Response.Redirect(apaymentlink)
    52.                     statuss.Text = "You have just confirmed succefully your reservation!"
    53.                    
    54.                 Loop
    55.  reader2.Close()
    56.  
    57.             End If
    58.  
    59.             '----------------------End of google-------------------------------------------------------------------
    60.  
    61.             '-----------------------For PayPal----------------------------------------------------
    62.             If apaypal.Trim = "True" Then
    63.                 Do While reader2.Read()
    64.                     apaymentlink = reader2("paypalpaymentlink").ToString()
    65.  
    66.                  
    67.  
    68.                     abcd = apaymentlink
    69.                     writer.WriteLine("<html><center><FORM ACTION=""https://www.paypal.com/cgi-bin/webscr"" METHOD=""POST""> <INPUT TYPE=""hidden"" NAME=""cmd"" VALUE=""_xclick""> <INPUT TYPE=""hidden"" NAME=""business"" VALUE=""xxxxxx"">  <INPUT TYPE=""hidden"" NAME=""item_name"" VALUE=""Limousine transportation"">   <INPUT TYPE=""hidden"" NAME=""amount"" VALUE="" " & abcd & " "">                  <INPUT TYPE=""hidden"" NAME=""currency_code"" VALUE=""USD"">                <INPUT TYPE=""hidden"" NAME=""first_name"" VALUE=""" & afirstname & """>                <INPUT TYPE=""hidden"" NAME=""last_name"" VALUE=""" & alastname & """>                <INPUT TYPE=""hidden"" NAME=""address1"" VALUE=""" & aadress & """>             <INPUT TYPE=""hidden"" NAME=""city"" VALUE=""" & acity & """>                <INPUT TYPE=""hidden"" NAME=""state"" VALUE=""" & astate & """>                <INPUT TYPE=""hidden"" NAME=""zip"" VALUE=""" & azip & """>                <INPUT TYPE=""hidden"" NAME=""lc"" VALUE=""US"">                <INPUT TYPE=""hidden"" NAME=""email"" VALUE=""" & aemail & """>                <INPUT TYPE=""hidden"" NAME=""night_phone_a"" VALUE=""" & aworknum & """>                             <INPUT TYPE=""image"" NAME=""submit"" BORDER=""0"" SRC=""http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"" ALT=""PayPal - The safer, easier way to pay online"">                <img alt="" border="" width=""1"" height=""1"" src=""https://www.paypal.com/en_US/i/scr/pixel.gif"">                </FORM> </FORM></html>")
    70.                     writer.Close()
    71.                     Response.Redirect("c:/paynoww.html")
    72.                  
    73.                 Loop
    74.  
    75.   reader2.Close()
    76.             End If
    77.  
    78.         End If

    thank you
    Last edited by met0555; May 26th, 2011 at 10:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width