reverendleo
11-22-2005, 05:30 PM
Hello All!
This is the error message my VB.Net page is giving me:
Index was outside the bounds of the array.
This error is caused on the following line of code:
DA.Fill(ds, "MASTER_JCM_R1")
Here is the entire block of code:
<script runat="server">
Dim sConnect as String = "DSN=LacyLTD"
Dim conPerv As ODBCConnection = New ODBCConnection(sConnect)
Sub JPS_Click(sender As Object, e As EventArgs)
Dim strSQL as String = "SELECT * FROM MASTER_JCM_R1 WHERE ltrim(JOB) = '" & TextJobPerf.Text & "'"
Dim cmdMbrs As ODBCCommand = New ODBCCommand(strSQL,conPerv)
Dim DA as ODBCDataAdapter = New ODBCDataAdapter
DA.SelectCommand = cmdMbrs
Dim ds As DataSet = New DataSet
Dim MASTER_JCM_R1 as DataTable = New DataTable
DA.Fill(ds, "MASTER_JCM_R1")
End Sub
</script>
I'm sure the connection is good, as it has worked on a different page; but this seems to be an issue of the DataSet not defaulting to a large enough index? Not sure, but would love to hear from anyone with an idea.
Thanks much.
This is the error message my VB.Net page is giving me:
Index was outside the bounds of the array.
This error is caused on the following line of code:
DA.Fill(ds, "MASTER_JCM_R1")
Here is the entire block of code:
<script runat="server">
Dim sConnect as String = "DSN=LacyLTD"
Dim conPerv As ODBCConnection = New ODBCConnection(sConnect)
Sub JPS_Click(sender As Object, e As EventArgs)
Dim strSQL as String = "SELECT * FROM MASTER_JCM_R1 WHERE ltrim(JOB) = '" & TextJobPerf.Text & "'"
Dim cmdMbrs As ODBCCommand = New ODBCCommand(strSQL,conPerv)
Dim DA as ODBCDataAdapter = New ODBCDataAdapter
DA.SelectCommand = cmdMbrs
Dim ds As DataSet = New DataSet
Dim MASTER_JCM_R1 as DataTable = New DataTable
DA.Fill(ds, "MASTER_JCM_R1")
End Sub
</script>
I'm sure the connection is good, as it has worked on a different page; but this seems to be an issue of the DataSet not defaulting to a large enough index? Not sure, but would love to hear from anyone with an idea.
Thanks much.