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 IfI'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.