Showing posts with label clicks. Show all posts
Showing posts with label clicks. Show all posts

Saturday, March 31, 2012

There is no position at row 0

Hi:

I am getting this error when a transaction needs to write to the Database after the user clicks the submit button.

Any help on what is the cause is greatly appreciated.

Thanks in advance for your help.It's impossible to answer this without seeing some code and also the eventual stored procedure you are using to execute the transaction.
************* Edited by moderator Adec ***************
Inserted missing < code></ code> tags. Always include such
tags when including code in your postings. Many readers
disregard postings without the code tags.
**************************************************

Thanks. Here is the situation. I am updating a site which was given to me, and fairly new to .net. I am competent to decifer the situation with the help by a person who knows.
Now correct me if I am wrong. I see that it is going to write the transaction to a table called 'Transactions'. I'm looking at the table in the DB and the fields do not look like the fields it is looking for below. Now I am assuming that I should change the fields in this code to match exactly what is in the table. Also the fields in the table do not have the letters in front of the field name. Ex: iUserID, dtDateTime. It has UserID, DateTime.. etc. what are the letters in front for? Also the last line of this code, should there be a table called PublicPayInvoice created in the DB, because I don't see it. Not sure if that is the table it is looking for.

Thanks

The Code:


'Write the Transaction
If sX_Response_Code = "1" Then
Transactions.WriteTransaction(iUSerID, dtDateTime, iAccountID, sTransactionType, sMethod, sRecipientEmail, _
sx_Email, "YES", "NO", sX_Response_Code, sX_Response_Subcode, _
sX_Response_Reason_Code, sX_Response_Reason_Text, _
sX_Auth_Code, sX_AVS_Code, sX_Trans_ID, sX_Description, dProcessing, _
dTransactionFee, dChargeBackFee, dRefundFee, dPremiereFee, dRequestedAmount, _
dX_Amount, sIP, "PP")
Else
If sX_Auth_Code = "" Then
sX_Auth_Code = "0"
End If

Transactions.WriteTransaction(iUSerID, dtDateTime, iAccountID, sTransactionType, sMethod, sRecipientEmail, _
sx_Email, "NO", "YES", sX_Response_Code, sX_Response_Subcode, _
sX_Response_Reason_Code, sX_Response_Reason_Text, _
sX_Auth_Code, sX_AVS_Code, sX_Trans_ID, sX_Description, dProcessing, _
dTransactionFee, dChargeBackFee, dRefundFee, dPremiereFee, dRequestedAmount, _
dX_Amount, sIP, "PP")
End If
'Get the TransactionID
iTransactionID = Transactions.GetPublicTransactionID(iUSerID, sRecipientEmail, sx_Email)

Dim sTo As String
Dim sFrom As String
Dim sSubject As String
Dim sBody As String
Dim mail As New MailMessage()
Dim iTemp As Integer

If sX_Response_Code = 1 Then
Transactions.PublicPayInvoice(iUSerID, sCustomerInvoivceNum, iTransactionID, sTransactionType, sMethod, _
Left(Session.Contents.Item("x_Card_Num"), 4) & "-XXXX-XXXX-" _
& Right(Session.Contents.Item("x_Card_Num"), 4), sExpDate, _
Session.Contents.Item("x_Card_Code"), Session.Contents.Item(" _
"x_bank_Name"), Left(Session.Contents.Item("x_Bank_Acct_Num"), 2) _
& "XXXXXXXXXXXXXX" & Right(Session.Contents.Item("x_Bank_Acct_Num"), 4), _
Session.Contents.Item("x_Bank_ABA_Code"), sFirstName & " " & sLastName, _
sAddress, sCity, sState, sZip, sCountry, sCardType)


You are using an own Class called Transactions here. What do the methods from that Class used here look like?
The class is to long to post here for you to look at. Can I email it to you?
Firstly, sharpening up your communication skills would be a great help. How do you expect us to know what is going on if you don't give us the appropriate information? For example, what is the error that you talked about in your first post!?!

Secondly, the additional "letters in front of the field name" are simply a naming convention and relate to the ID of the Controls/Varaibles that you are using.

Thirdly (to reiterate Andre's point), Transaction is actually an Object (an instantiated Class) and isn't a table in the database.

Finally, PublicPayInvoice is a method of the Invoice Object, not another table.

> I am competent to decifer the situation with the help by a person who knows
Evidently not!!
WoW. Thanks for being so CRUEL!
I was just thinking the same about2flip thing after reading the post from stevenbey.

Its amazing why some tech's get a bad wrap for having god-like complex's, lol. Dealing with people (or answering forums) this guy should not!!!
>>Dealing with people (or answering forums) this guy should not!!!

There are many who would disagree (i.e. those people who's problems I have solved).

Tuesday, March 13, 2012

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.
In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.
It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"
Doing some googling suggested that I use
Response.Redirect("./myurl.aspx?ID=" + variable,false);
to allow the current thread to continue executing.
This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..
e.g. instead of looking like this...
http://www.website.com/myurl.aspx?ID=5
it looks like
http://www.website.com/myurl.aspx
It's like the redirect *never* happens...
Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
>
>
Hi Steve, you mean like this?
try
{
Response.Redirect("./myurl.aspx?ID=" + variable);
}catch (Exception ex)
{
}
I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...
Thanks again Steve..
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>
Yes, that's what I'm suggesting. Does it work for you?
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>
Hi Steve, no unfortunately not.
I did a try catch and caught the exception like so:
catch (Exception ex)
Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib
Thanks again for your help
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.
Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.

In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.

It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"

Doing some googling suggested that I use

Response.Redirect("./myurl.aspx?ID=" + variable,false);

to allow the current thread to continue executing.

This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..

e.g. instead of looking like this...

http://www.website.com/myurl.aspx?ID=5

it looks like

http://www.website.com/myurl.aspx

It's like the redirect *never* happens...

Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
Hi Steve, you mean like this?

try
{
Response.Redirect("./myurl.aspx?ID=" + variable);

}catch (Exception ex)
{

}

I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...

Thanks again Steve..
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>> Hi all, I have a user control which raises an event to the parent page
>> when a person clicks on a link in a datagrid.
>>
>> In the event handler inside the parent page I construct a url to redirect
>> to containing information sent from the datagrid.
>>
>> It all works fine on my local machine but when I send it to the live
>> server I receive "The thread was being aborted"
>>
>> Doing some googling suggested that I use
>>
>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>
>> to allow the current thread to continue executing.
>>
>> This stops the error but what I am now finding is that the redirect does
>> not have the querystring attributes attached to it..
>>
>> e.g. instead of looking like this...
>>
>> http://www.website.com/myurl.aspx?ID=5
>>
>> it looks like
>>
>> http://www.website.com/myurl.aspx
>>
>>
>> It's like the redirect *never* happens...
>>
>> Help appreciated
>> Thanks
>> Mark
>>
>>
>>
Yes, that's what I'm suggesting. Does it work for you?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>> Put your Response.Redirect back to the way it was, without the false
>> parameter.
>> Then wrap it in a Try/Catch statement to eat the error that's raised from
>> the redirect.
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>> Hi all, I have a user control which raises an event to the parent page
>>> when a person clicks on a link in a datagrid.
>>>
>>> In the event handler inside the parent page I construct a url to
>>> redirect to containing information sent from the datagrid.
>>>
>>> It all works fine on my local machine but when I send it to the live
>>> server I receive "The thread was being aborted"
>>>
>>> Doing some googling suggested that I use
>>>
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>
>>> to allow the current thread to continue executing.
>>>
>>> This stops the error but what I am now finding is that the redirect does
>>> not have the querystring attributes attached to it..
>>>
>>> e.g. instead of looking like this...
>>>
>>> http://www.website.com/myurl.aspx?ID=5
>>>
>>> it looks like
>>>
>>> http://www.website.com/myurl.aspx
>>>
>>>
>>> It's like the redirect *never* happens...
>>>
>>> Help appreciated
>>> Thanks
>>> Mark
>>>
>>>
>>>
>>
>>
Hi Steve, no unfortunately not.

I did a try catch and caught the exception like so:

catch (Exception ex)

Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib

Thanks again for your help
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>> Hi Steve, you mean like this?
>>
>> try
>> {
>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>
>> }catch (Exception ex)
>> {
>>
>> }
>>
>> I have seen other people say take the
>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>> catch block...
>> I understand why this is hapenning but cannot understand how to fix it...
>>
>> Thanks again Steve..
>> Cheers
>> Mark
>>
>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>> Put your Response.Redirect back to the way it was, without the false
>>> parameter.
>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>> from the redirect.
>>>
>>> --
>>> I hope this helps,
>>> Steve C. Orr, MCSD, MVP
>>> http://SteveOrr.net
>>>
>>>
>>>
>>> "Jimi" <dontspam@.me.com> wrote in message
>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>> Hi all, I have a user control which raises an event to the parent page
>>>> when a person clicks on a link in a datagrid.
>>>>
>>>> In the event handler inside the parent page I construct a url to
>>>> redirect to containing information sent from the datagrid.
>>>>
>>>> It all works fine on my local machine but when I send it to the live
>>>> server I receive "The thread was being aborted"
>>>>
>>>> Doing some googling suggested that I use
>>>>
>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>
>>>> to allow the current thread to continue executing.
>>>>
>>>> This stops the error but what I am now finding is that the redirect
>>>> does not have the querystring attributes attached to it..
>>>>
>>>> e.g. instead of looking like this...
>>>>
>>>> http://www.website.com/myurl.aspx?ID=5
>>>>
>>>> it looks like
>>>>
>>>> http://www.website.com/myurl.aspx
>>>>
>>>>
>>>> It's like the redirect *never* happens...
>>>>
>>>> Help appreciated
>>>> Thanks
>>>> Mark
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.

Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>> Yes, that's what I'm suggesting. Does it work for you?
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>>> Hi Steve, you mean like this?
>>>
>>> try
>>> {
>>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>>
>>> }catch (Exception ex)
>>> {
>>>
>>> }
>>>
>>> I have seen other people say take the
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>>> catch block...
>>> I understand why this is hapenning but cannot understand how to fix
>>> it...
>>>
>>> Thanks again Steve..
>>> Cheers
>>> Mark
>>>
>>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>>> Put your Response.Redirect back to the way it was, without the false
>>>> parameter.
>>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>>> from the redirect.
>>>>
>>>> --
>>>> I hope this helps,
>>>> Steve C. Orr, MCSD, MVP
>>>> http://SteveOrr.net
>>>>
>>>>
>>>>
>>>> "Jimi" <dontspam@.me.com> wrote in message
>>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>>> Hi all, I have a user control which raises an event to the parent page
>>>>> when a person clicks on a link in a datagrid.
>>>>>
>>>>> In the event handler inside the parent page I construct a url to
>>>>> redirect to containing information sent from the datagrid.
>>>>>
>>>>> It all works fine on my local machine but when I send it to the live
>>>>> server I receive "The thread was being aborted"
>>>>>
>>>>> Doing some googling suggested that I use
>>>>>
>>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>>
>>>>> to allow the current thread to continue executing.
>>>>>
>>>>> This stops the error but what I am now finding is that the redirect
>>>>> does not have the querystring attributes attached to it..
>>>>>
>>>>> e.g. instead of looking like this...
>>>>>
>>>>> http://www.website.com/myurl.aspx?ID=5
>>>>>
>>>>> it looks like
>>>>>
>>>>> http://www.website.com/myurl.aspx
>>>>>
>>>>>
>>>>> It's like the redirect *never* happens...
>>>>>
>>>>> Help appreciated
>>>>> Thanks
>>>>> Mark
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>