My clients are complaining about having to hit a SAVE button - used to enter data in a VB6 msflexgrid and I would autosave at the end of each row!
They are going to complain that the report doesn't just download automatically - why do they have to click the PRINTER ICON to start a report and then wait until it says it's ready to download - and "what do you mean I've got to click DOWNLOAD?!!?!??!".
When you write custom software for clients - and want to get paid the best $$'s - they are always right. Customer is always right
Initial use will be dozens of users - running several reports a day.
But I've got clients with 100's and even one with 1000+ users with the old VB6 app - when we migrate them things are going to have to scale.
At this point I've tested this code - and my CPU on my development machine does not go crazy. I do not want to use a TIMER as that starts on another thread and that seems really dangerous in IIS as it's got it's own threading issues to deal with. I'm going to move the DB CONNECTION OPEN outside the loop - no reason to open/close a connection 20 times in a loop...
Code:If ctrloption = "reportstatus" Then Try Dim maxloop As Integer = 20 Dim curloop As Integer = 0 Do While strMessage <> "C" And curloop < maxloop Using dcn As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("LocalSQLServerAWC").ToString) Using cmd As New SqlCommand cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "dbo.awc_ReportGetStatus" cmd.Connection = dcn cmd.CommandTimeout = 0 DetermineParameters(dcn, cmd) cmd.Parameters("@RptId").Value = ctrlval1 dcn.Open() strMessage = cmd.ExecuteScalar().ToString End Using End Using If strMessage <> "C" Then curloop += 1 Threading.Thread.Sleep(250) End If Loop .NewObject("reportstatus", "true") .Seperate() .NewObject("rptid", ctrlval1) .Seperate() Catch ex As Exception strSuccess = "" strMessage = ex.Message End Try End If





Reply With Quote