Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compact framework
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00765804
Message ID:
00767195
Vues:
21
You don't get the same speed on the Pocket PC as on a desktop so the formatting of the data can cause the slowdown since you are iterating through each row.

>Only 48 items. Based on formatting issues and type issues (The ID field is typed Numeric (18,0). This type in VB.NET translates to SqlDecimal.) - I load it using the following code.
>
>
>
>Dim lADO As clsCeDataClass = New clsCeDataClass
>Dim lstData As clsListOrComboBoxData = New clsListOrComboBoxData
>Dim arlData As New ArrayList
>Dim strClient As String
>Dim strTime As String
>Dim strSeq As String
>Dim strPSeq As String
>Dim strStartDate As String
>Dim strEndDate As String
>Dim strPrefix As String
>Dim strSufix As String
>Dim strLine As String
>Dim intLoaded As Int16
>Dim ldrRoute As DataRow
>
>intLoaded = 0
>WaitCursor(True)
>
>Me.lstRoutes.DisplayMember = ""
>Me.lstRoutes.ValueMember = ""
>Me.lstRoutes.DataSource = Nothing
>
>strStartDate = FormatDateTime(Now, vbShortDate) & " 00:00:01"
>strEndDate = FormatDateTime(Now, vbShortDate) & " 23:59:59"
>
>lADO.strSQL = "SELECT ID, Sequence, Location, DateScheduled, " & _
>                   "LocationID, Stopped " & _
>              "FROM tRoutes " & _
>              "WHERE (RouteID='" & Trim(CStr(glngRouteID)) & "') AND " & _
>                   "(DateScheduled >='" & strStartDate & "') AND " & _
>                   "(DateScheduled <='" & strEndDate & "') " & _
>              "ORDER BY Sequence"
>lADO.RetrieveData(lADO.objDS, "tRoutes")
>
>For Each ldrRoute In lADO.objDS.Tables("tRoutes").Rows
>    intLoaded = 1
>    strSeq = CStr(CInt(ldrRoute("Sequence")))
>
>    If Len(strSeq) = 1 Then
>          strSeq = " " & strSeq
>    End If
>
>    If strSeq <> strPSeq Then
>          strClient = ClientName(Convert.ToString(ldrRoute("LocationID")))
>          strTime = FormatDateTime(ldrRoute("DateScheduled"), vbShortTime)
>          lstData.DisplayData = strSeq & ": " & strTime & " - " & _
>                                strClient & " (" & ldrRoute("Location") & ")"
>          lstData.ValueData = Convert.ToInt64(Convert.ToString _
>                             (ldrRoute("ID")))
>
>          If ldrRoute("Stopped") = "Y" Then
>
>              'Fix Display
>              strLine = lstData.DisplayData
>              If InStr(1, strLine, Chr(164)) = 0 Then
>                  strPrefix = Mid(strLine, 1, InStr(1, strLine, "-") - 1)
>                  strSufix = Mid(strLine, InStr(1, strLine, "-") + 1)
>                  strLine = strPrefix & Chr(164) & strSufix
>                  lstData.DisplayData = strLine
>              End If
>
>          End If
>
>          arlData.Add(lstData)
>    End If
>    strPSeq = strSeq
>    lstData = New clsListOrComboBoxData
>Next
>
>If intLoaded < 1 Then
>    lstData.DisplayData = "No routes scheduled"
>    lstData.ValueData = 0
>    arlData.Add(lstData)
>Else
>    strSeq = Trim(CStr(CInt(strSeq) + 1))
>    lstData.DisplayData = strSeq & ": " & strTime & " - END OF DAY (EOD)"
>    lstData.ValueData = 99999
>    arlData.Add(lstData)
>End If
>
>Me.lstRoutes.DataSource = arlData
>Me.lstRoutes.DisplayMember = "DisplayData"
>Me.lstRoutes.ValueMember = "ValueData"
>
>WaitCursor(False)
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform