Showing posts with label button. Show all posts
Showing posts with label button. 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).

Wednesday, March 28, 2012

There is not enough space on the disk.

Hi

when i click a button for pop up window, i face this problem. but my C drive got 750 MB space. what should be the reason?. i tried with different username for the server also but still the same isssue as below.


There is not enough space on the disk.
Description: An unhandled exception occurred during compilation using the CodeDomProvider 'Microsoft.VisualBasic.VBCodeProvider'. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: There is not enough space on the disk.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[IOException: There is not enough space on the disk.
]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) +134
System.IO.FileStream.FlushWrite() +55
System.IO.FileStream.Flush() +39
System.IO.FileStream.Dispose(Boolean disposing) +32
System.IO.FileStream.Close() +17
System.CodeDom.Compiler.CodeCompiler.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) +382
System.CodeDom.Compiler.CodeCompiler.FromDom(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType() +224


Jose,

Try clearing the Temp files in the Framework directory. it worked for me. Smile

Thursday, March 22, 2012

Thoughts about using Session variables for login security?

I am creating a simple website with a login page and some "admin only"
pages.
In my login page's submit button I just say if the "password is correct"
then...
session("IsAdmin") = True
In my admin only pages I check if session("IsAdmin") = True
If it's NOT then I redirect them to the login.aspx page.
Is this solution pretty solid, or is it easy to hack? I keep the password
in the web.config appsettings section so it's easy to change.
I know I could use Membership stuff, but I'm just doing a simple, quick
website.
Your thoughts are appreciated!Hello Bobby,

> I am creating a simple website with a login page and some "admin only"
> pages.
> In my login page's submit button I just say if the "password is
> correct"
> then...
> session("IsAdmin") = True
> In my admin only pages I check if session("IsAdmin") = True If it's
> NOT then I redirect them to the login.aspx page.
> Is this solution pretty solid, or is it easy to hack? I keep the
> password in the web.config appsettings section so it's easy to change.
> I know I could use Membership stuff, but I'm just doing a simple,
> quick website.
Membership is there, membership is quick and membership works out of the
box from the web.config if you need it to.
My experience is that this quick and simple website will run for the coming
20 years and that every time you need to change somthing you hoped you did
it the right way first time round...
--
Jesse Houwing
jesse.houwing at sogeti.nl
I've done the same thing in the past. There is one and only quesion
you need to ask: "is this doing what I need it to?" From your post the
answer is "yes," so you're good. But I see you're asking "is it easy
to hack?"
And the answer is a resounding "no." Session variables are stored in
the server's memory. In order to access them a hacker would need to
hack the server itself and gain access to it's memory. If that
happens, having them view your session variables would be the very
least of your concerns.
On Mar 5, 2:33=A0pm, "Bobby Edward" <t...@.test.com> wrote:
> I am creating a simple website with a login page and some "admin only"
> pages.
> In my login page's submit button I just say if the "password is correct"
> then...
> session("IsAdmin") =3D True
> In my admin only pages I check if session("IsAdmin") =3D True
> If it's NOT then I redirect them to the login.aspx page.
> Is this solution pretty solid, or is it easy to hack? =A0I keep the passwo=[/color
]
rd
> in the web.config appsettings section so it's easy to change.
> I know I could use Membership stuff, but I'm just doing a simple, quick
> website.
> Your thoughts are appreciated!
I'd look at Jesse's recommendation about using the built-in membership
system in ASP.Net 2.0 if you really want to have some flexibility. You can
then use Roles to manage your users. For administrators, you can create an
Admin role and assign the users to that role. Then all you have to do is
test if the user is in that role. Actually, better yet, you can set the
authorization section of the web.config file so that only certain users or
roles have access to particular files or folders. This let's you tweak
security in a config file without worrying about coding it in every single
page.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
"Bobby Edward" <test@.test.com> wrote in message
news:%23dULGfvfIHA.1188@.TK2MSFTNGP04.phx.gbl...
>I am creating a simple website with a login page and some "admin only"
>pages.
> In my login page's submit button I just say if the "password is correct"
> then...
> session("IsAdmin") = True
> In my admin only pages I check if session("IsAdmin") = True
> If it's NOT then I redirect them to the login.aspx page.
> Is this solution pretty solid, or is it easy to hack? I keep the password
> in the web.config appsettings section so it's easy to change.
> I know I could use Membership stuff, but I'm just doing a simple, quick
> website.
> Your thoughts are appreciated!
>

Tuesday, March 13, 2012

thread was being aborted

Hi, everyone

I create one application with form authentication.

When I try to run application and press login button it will redirect to default page and application run success fully, some time it will not redirect to default page .

For my application, I have to create one txt log file for error …

Sometime this error occurs when I press login button….

--------------------------

Source Code : mscorlib

Error Message : Thread was being aborted.

Stack Trace : at System.Threading.Thread.AbortInternal()

at System.Threading.Thread.Abort()

at System.Threading.Thread.Abort(Object stateInfo)

at System.Web.HttpResponse.End()

at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)

at System.Web.HttpResponse.Redirect(String url)

at pms._default.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\aspnet\pms\default.aspx.vb:line 104

--------------------------

source code for login button is……

--------------------------

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

Try

singleSqlString = "SELECT emp_code,password,access_level,emp_name " & _

"FROM login_master " & _

"WHERE emp_code='" & txtEmpCode.Text & "' AND password='" & txtPassword.Text & "' " & _

"ORDER BY emp_code ASC"

objlogin.FillDataSet(singleSqlString, "login_master")

If objlogin.dtSet.Tables("login_master").Rows.Count > 0 Then

Session("LoginCode") = txtEmpCode.Text

Session("EmpName") = objlogin.dtSet.Tables("login_master").Rows(0).Item("emp_name")

Session("AccessLevel") = objlogin.dtSet.Tables("login_master").Rows(0).Item("access_level")

FormsAuthentication.RedirectFromLoginPage(txtEmpCode.Text, False)

Else

lblmsg.Text = " Employee Code or Password may be wrong. - Try Again !!"

txtEmpCode.Text = ""

txtPassword.Text = ""

End If

Catch ex As ThreadAbortException

lblmsg.Visible = True

lblmsg.Text = "Thread is aboard"

Catch ex As Exception

objlogin.CreateLogFile(ex, objlogin.Message)

End Try

End Sub

--------------------------

when I trace my application using break point exception is not generated , but error occurs

plz give any solution and cause for this error.

Thanks in advance

Hi,

The error generated appears to be occuring on the default page:

at pms._default.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\aspnet\pms\default.aspx.vb:line 104

Have you checked/debugged the code here to see what's happening?