Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 3.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2005, 05:30 PM   PM User | #1
reverendleo
New Coder

 
Join Date: May 2005
Location: The Lone Star State
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
reverendleo is an unknown quantity at this point
Unhappy Index was outside the bounds of the array.

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:

Code:
DA.Fill(ds, "MASTER_JCM_R1")
Here is the entire block of code:

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.
reverendleo is offline   Reply With Quote
Old 11-22-2005, 08:58 PM   PM User | #2
reverendleo
New Coder

 
Join Date: May 2005
Location: The Lone Star State
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
reverendleo is an unknown quantity at this point
FYI: in case anyone was curious:

I took out the * in the SQL and gave it a specific field to pull. Runs like a champ. I guess there's some kind of limit as to the number of fields it likes.

Code:
Dim strSQL as String = "SELECT JOB FROM MASTER_JCM_R1 WHERE JOB = '" & TextJobPerf.Text & "'"
reverendleo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:36 PM.


Advertisement
Log in to turn off these ads.