I have the following code...
Public Sub SelectPieceByPr oductID()
Try
Dim arParams(0) As SqlParameter
arParams(0) = New SqlParameter("@ lProductID", lProductID)
Dim oDR As SqlDataReader =
oData.ExecuteRe ader(sConnectio nString, CommandType.Sto redProcedure,
"spSelectPieceB yProductID", arParams)
If oDR.HasRows Then
Do While oDR.Read()
sPieceNumber = CType(oDR.Item( "PieceNumbe r"),
String)
lMetalID = CType(oDR.Item( "MetalID"), Long)
lTotalCount = CType(oDR.Item( "TotalCount "), Long)
dTotalWeight = CType(oDR.Item( "TotalWeigh t"),
Double)
---> lNonCenterCount =
CType(oDR.Item( "NonCenterC ount "), Long)
dNonCenterWeigh t =
CType(oDR.Item( "NonCenterWeigh t"), Double)
dPrice = CType(oDR.Item( "Price"), Double)
lMarkup = CType(oDR.Item( "Markup"), Long)
bActive = CType(oDR.Item( "Active"), Boolean)
bDeleted = CType(oDR.Item( "Deleted"), Boolean)
Loop
End If
oDR.Close()
oDR = Nothing
oData = Nothing
Catch ex As Exception
End Try
End Sub
I am getting an "System.IndexOu tOfRangeExcepti on" exception on the
marked line. All values prior to this line are being set correctly.
Anyone see the issue here? I run the query in query analyzer with the
appropriate id and it works fine.
I'm clueless.
Thanks. 1 4662
It seems that the NonCenterCount column does not exist. Perhaps the column
name is mispelled either here, or in the table definition.
"Ratman" <ja**@attis.org > wrote in message
news:df******** *************** ***@posting.goo gle.com... I have the following code...
Public Sub SelectPieceByPr oductID()
Try
Dim arParams(0) As SqlParameter
arParams(0) = New SqlParameter("@ lProductID", lProductID)
Dim oDR As SqlDataReader = oData.ExecuteRe ader(sConnectio nString, CommandType.Sto redProcedure, "spSelectPieceB yProductID", arParams)
If oDR.HasRows Then Do While oDR.Read() sPieceNumber = CType(oDR.Item( "PieceNumbe r"), String) lMetalID = CType(oDR.Item( "MetalID"), Long) lTotalCount = CType(oDR.Item( "TotalCount "), Long) dTotalWeight = CType(oDR.Item( "TotalWeigh t"), Double) ---> lNonCenterCount = CType(oDR.Item( "NonCenterC ount "), Long) dNonCenterWeigh t = CType(oDR.Item( "NonCenterWeigh t"), Double) dPrice = CType(oDR.Item( "Price"), Double) lMarkup = CType(oDR.Item( "Markup"), Long) bActive = CType(oDR.Item( "Active"), Boolean) bDeleted = CType(oDR.Item( "Deleted"), Boolean) Loop End If
oDR.Close()
oDR = Nothing oData = Nothing
Catch ex As Exception
End Try
End Sub
I am getting an "System.IndexOu tOfRangeExcepti on" exception on the marked line. All values prior to this line are being set correctly. Anyone see the issue here? I run the query in query analyzer with the appropriate id and it works fine.
I'm clueless.
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: William McIlroy |
last post by:
Array Bounds Exception inside system.xml.dll. Test data is a dozen GB (available for the asking on CD). Source code follows. Call into system.xml.dll happens at the while statement..
using System
using System.Xml
using System.Collections
// This program reads an ASCII file of XML elements
// The output is a list of unique NODE TYPEs
// For example, <head> produces head in the output
// There is no validation of the XML
|
by: Juan Galdeano |
last post by:
Hi,
I'm working on an ONIX project and when I try to validate or read XML
files C# gives me this exception:
System.IndexOutOfRangeException
at System.Xml.XmlScanner.ScanDtdContent()
at System.Xml.Schema.DtdParser.ScanDtdContent()
at System.Xml.Schema.DtdParser.ParseDtdContent()
at System.Xml.Schema.DtdParser.ParseDocTypeDecl()
|
by: Tylius |
last post by:
This one line is causing the issue, I've searched all over the net, but I
can't seem to figure out why
public static void Main(string args)
{
Console.WriteLine("Dice Roller");
try
{
int num_dice = int.Parse(args); // This is the problem
|
by: Stephen.Haeney |
last post by:
I have a datagrid bound to a strongly typed custom collection. I have
a Delete button on my form that calls the following code:
if ( this.BindingContext.Count > 0 )
{
myDataSource.RemoveAt( this.BindingContext.Position
);
}
I was expecting the button press to remove the elevant row from the
|
by: |
last post by:
Using the following against a sql database, I get a
system.IndexOutOfRangeException for the column name Add_Date which is valid
field name and is a datetime field. All the other columns work ok. Does
anybody have any ideas. I'm new with .Net and this is driving me crazy.
Dim intTblAddDate As Integer = myReader.GetOrdinal("Add_Date")
Thanks in advance... Dick Bellnier
| |
by: Robert Batt |
last post by:
Hello,
I have a problem deleting from a datagrid bound to a dataset. then datagrid is bound as follows
MyDatagrid.DataSource = Mydataset.Tables(strtable
this works fine for adding and updating, but when I try and delete something I often get a system.indexoutofrangeexception
What is this about? there is nothing in the knowledgeabase about this
Any ideas what is going wron
|
by: Michael Primeaux |
last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single
web method with the following signature:
void HelloWorld(Guid parameter1);
When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
|
by: Susan |
last post by:
I have an issue with the System.Collections.Generic.List that I can't
find anywhere else...
My website suddenly starts giving off System.IndexOutOfRangeException:
Index was outside the bounds of the array. errors in a spot that I
cannot figure out the problem. It will work all day, then suddenly
start giving off the error, which makes quite a bit fail.
The error (System.IndexOutOfRangeException: Index was outside the
bounds of the...
|
by: Mike |
last post by:
Hi,
I have a collection object bound to a data grid, after I remove an
item from the collection, the minute I click on the datagrid I get an
error saying the specified argument was out of the range of valid
values.
After I remove the element from the collection I clear the
databindings from the data grid and rebind it but as far as I can tell
the collection seems to be the right size but for some reason when I
|
by: =?Utf-8?B?aW1yYW4uYQ==?= |
last post by:
Hi all,
I am having a problem with inserting rows in to my datagridview control. The
datagridview is bound to a bindingsource with a filter set. If i try and add
a row to the datagridview while the filter is set i get an
IndexOutOfRangeException specifying that the index of the row i have just
added does not exist. I have managed to narrow down the conditions that cause
the error and it seems to surface if i have a filter set for a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |