When the control comes to the following routine, the system has already fetched records from AS/400 and placed it in a table called "TicketSales". Then this routine follows...
Private Sub cmdProcessTickets_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdProcessTickets.Click
Dim TotTickets, i, FoundRow, TotMSRec, TotSSRec, TotQSRec As Integer
Dim mAgentCode, mSector As String
Dim mSectorFrom, mSectorTo As String
Dim mClass, mRegionId, mAllSectorRegionId As Char
Dim mAmount As Double
Dim mRow As Data.DataRow
'Get the RegionId that includes All Sectors
DsRegionK1.Clear()
DARegion.Fill(DsRegionK1, "RegionMaster")
If DsRegionK1.Tables(0).Rows.Count > 0 Then
mAllSectorRegionId = DsRegionK1.Tables(0).Rows(0).Item("RegionId")
Else
mAllSectorRegionId = "#"
End If
'Read Ticket Sales
'Write to Monthly Sales, SectorSales, and QuarterSales
Try
DsTicketSales1.Clear()
DATicketSales.SelectCommand.Parameters("@YearNo").Value = MyCurrYear
DATicketSales.SelectCommand.Parameters("@MonthNo").Value = MyCurrMonth
DATicketSales.Fill(DsTicketSales1, "TicketSales")
TotTickets = DsTicketSales1.Tables(0).Rows.Count
Catch ex As Exception
MsgBox("Error: " + ex.Message)
End Try
For i = 0 To TotTickets - 1
......... lot of code here.........
Next i
The program fails at the code
DATicketSales.Fill(DsTicketSales1, "TicketSales")
The error message is,
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.