Showing posts with label busy. Show all posts
Showing posts with label busy. Show all posts

Saturday, March 31, 2012

Web server busy

Hi, I created access database and let people checkin and checkout. I created four buttons, but every time it seems that when people clcik the second one, it gives web server is busy message. It takes quite a while to retrive the page and then check in. It seems that not many people check in at that time. Would any expert look at my code? I really appreciate it and thanks!!!!

Sub Check_Test(sender as Object, e as EventArgs)



Dim currEmpNumber As String = employeeID.Text

currEmpNumber = checkUserInput(currEmpNumber.Trim())

strSQL="Select * from Employee WHERE IDEmployee= '" & currEmpNumber & "'"



call openDB()

Dim objDR as OleDbDataReader
Dim Cmd as New OleDbCommand(strSQL, connTemp)

objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)


While objDR.Read()
currName=ValidateInputForDB(objDR("Name"))

End While

call CloseDB()

Call OpenDB()



strSQL="Select IDEmployee from Employee WHERE IDEmployee= '" & currEmpNumber & "'"
Dim myCommand1 As New OleDbCommand(strSQL, connTemp)
currEmpID = myCommand1.ExecuteScalar()
If currEmpID = 0 Then
labelMessage.text = "<blockquote><font size=6 color='blue'><b>* Wrong No! Please try again!</font>"
labelMessage1.visible=false


Else
Dim myCountEmployee as Int32 = 0


strSQL="Select count(*) from Clock WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "'"
Dim myCommand3 As New OledbCommand(strSQL, connTemp)
myCountEmployee = myCommand3.ExecuteScalar()


If myCountEmployee = 0 Then

labelMessage.text = "<blockquote><font size=6 color='blue'><b>* Sorry! </font>"
labelMessage1.visible=false
else

If myCountEmployee > 0 Then

strSQL="UPDATE Clock SET OutWork1 = '" & currServerTime & "' WHERE IDEmployee= '" & currEmpNumber & "' and serverDate = '" & currServerDate & "' and Outwork1 = '' "

call InsertUpdate(strSQL)

call CloseDB()

End IF
end if
end if
labelMessage1.text ="Bye, " & cstr(currName) &"!" & " "


End Sub

hi,

i'm not an expert, i'm neither familiar with VB. I'm coding in c#, but it looks to me that you don't close the db connection every time.

If myCountEmployee > 0 Then

strSQL="UPDATE Clock SET OutWork1 = '" & currServerTime &"' WHERE IDEmployee= '" & currEmpNumber & "' and serverDate= '" & currServerDate & "' and Outwork1 = '' "

call InsertUpdate(strSQL)

call CloseDB()

End IF

it think the connection is closed only when there are any employees ?

And it is opened before the if, so it should be closed not in the if clause.

If my assumption is right, it is possible to run out of sql connections very soon, which may causes your problem.

If i'm wrong sorry for puzzling you more :)

Cheers,

Yani

Web server Busy Problem

hi,
I have an application that connect to another server when the user
press
a button but the problem is that if the user clicked the button many
times
and error page
" There are too many people accessing the Web site at this time. "

so i want a way to work around it so the user can't click the button
twice before IIS finish executing the first time code postback.

thanx,hi,
I meant to say that i want a way to let the user of a web application
press the button only one time before the request return back(the
process of postback take around 10 seconds). with in 10 seconds i don't
want the user to press the button again.
I thing you are fixing the thing that is not broken.

This message happens on IIS development version which comes with Windows XP
or Win2000 workstation.

Once you move your application to Windows Server edition you will not have
that problem.

George.

"Octopus0" <ahmadbsher@.gmail.com> wrote in message
news:1144049233.021016.107170@.i40g2000cwc.googlegr oups.com...
> hi,
> I have an application that connect to another server when the user
> press
> a button but the problem is that if the user clicked the button many
> times
> and error page
> " There are too many people accessing the Web site at this time. "
> so i want a way to work around it so the user can't click the button
> twice before IIS finish executing the first time code postback.
>
> thanx,

Web server Busy Problem

hi,
I have an application that connect to another server when the user
press
a button but the problem is that if the user clicked the button many
times
and error page
" There are too many people accessing the Web site at this time. "
so i want a way to work around it so the user can't click the button
twice before IIS finish executing the first time code postback.
thanx,hi,
I meant to say that i want a way to let the user of a web application
press the button only one time before the request return back(the
process of postback take around 10 seconds). with in 10 seconds i don't
want the user to press the button again.
I thing you are fixing the thing that is not broken.
This message happens on IIS development version which comes with Windows XP
or Win2000 workstation.
Once you move your application to Windows Server edition you will not have
that problem.
George.
"Octopus0" <ahmadbsher@.gmail.com> wrote in message
news:1144049233.021016.107170@.i40g2000cwc.googlegroups.com...
> hi,
> I have an application that connect to another server when the user
> press
> a button but the problem is that if the user clicked the button many
> times
> and error page
> " There are too many people accessing the Web site at this time. "
> so i want a way to work around it so the user can't click the button
> twice before IIS finish executing the first time code postback.
>
> thanx,
>