Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with an error - VB.net/WebForm
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Help with an error - VB.net/WebForm
Divers
Thread ID:
00671381
Message ID:
00671381
Vues:
39
Here is the error message I am getting:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IndexOutOfRangeException: Index 1 is not non-negative and below total rows count.

Source Error: 


Line 49:         iRecords = VFPToolkit.vfpData.Count(goView)
Line 50:         If iRecords > 0 Then
ERROR HERE ==>Line 51:             txt_Status.Text = (goView(1)("docname").ToString())
Line 52:         Else
Line 53:             txt_Status.Text = "Status: Invalid Login"
 
Here is the code for when the user clicks the login button:
        Dim lcConnectionString As String
        Dim lcSQL As String
        Dim oConn As OleDb.OleDbConnection
        Dim goView As Data.DataView
        Dim iRecords As Integer
        Dim cStatusText As String

        'Get the connection string and sql statement
        lcConnectionString = "provider=sqloledb.1;server=cqi-termserv;uid=ctore;pwd=bubba;database=ctore"
        lcSQL = "Select rtrim(lastname)+', '+rtrim(firstname) as docname from coper where coPerID=1"

        'Connect to the Database, execute the query and disconnect
        'SqlConnect(), SqlExecute(), SqlDisconnect()
        oConn = VFPToolkit.vfpData.SqlConnect(lcConnectionString)
        goView = VFPToolkit.vfpData.SqlExecute(oConn, lcSQL, "DocList")
        VFPToolkit.vfpData.SqlDisConnect(oConn)

        'Select the default cursor
        VFPToolkit.vfpData.Select(goView)
        iRecords = VFPToolkit.vfpData.Count(goView)
        If iRecords > 0 Then
            txt_Status.Text = (goView(1)("docname").ToString())
        Else
            txt_Status.Text = "Status: Invalid Login"
        End If
I'm using the vfptoolkit and checking to make sure the recount is greater than 0, so I don't understand why i'm bombing here.

Has anybody written a white paper on using the vfptoolkit, I'd like to read more details on how to use it?

Thanks for any help

Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform