Re: SqlDataAdapter.Fill throws me an IndexOutOfRangeException

From: Val Mazur (group51a_at_hotmail.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 18:47:04 -0500

Hi,

You showed us what you have on a server side, but actually did not show the
code, which throws the exception. What is this code?

-- 
Val Mazur
Microsoft MVP
"Uri Dor" <tablul@newsgroups.nospam> wrote in message 
news:O%23JRb$KzEHA.2200@TK2MSFTNGP09.phx.gbl...
> for some reason, a specific database state gives me an 
> IndexOutOfRangeException when I call SqlDataAdapter.Fill (in several cases 
> the same code doesn't throw the exception)
>
> the SELECT is:
> SELECT Bank_sec_code, Dt, Par_val, Rate, Rate_nis FROM dbo.Common_rates 
> WHERE (Dt = @dt)
>
> I supply a valid @dt parameter
>
> when I run the query from query analyzer I get a valid, nonempty result.
>
> when I script the table I get:
> if exists (select * from dbo.sysobjects where id = 
> object_id(N'[dbo].[Common_rates]') and OBJECTPROPERTY(id, N'IsUserTable') 
> = 1)
> drop table [dbo].[Common_rates]
> GO
>
> CREATE TABLE [dbo].[Common_rates] (
> [Bank_sec_code] [int] NOT NULL ,
> [Dt] [datetime] NOT NULL ,
> [Par_val] [float] NOT NULL ,
> [Rate] [float] NOT NULL ,
> [Rate_nis] [float] NOT NULL
> ) ON [PRIMARY]
> GO
>
> ALTER TABLE [dbo].[Common_rates] WITH NOCHECK ADD
> CONSTRAINT [PK_Common_rates] PRIMARY KEY  CLUSTERED
> (
> [Bank_sec_code],
> [Dt]
> )  ON [PRIMARY]
> GO
>
>
> Any ideas? 


Relevant Pages

  • RE: Backup & Monitoring not working!
    ... Error message in Windows Small Business Server 2003: ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.windows.server.sbs)
  • Re: Sharepoint 2007 - Installation Error - Failed to register SP s
    ... Windows 2000 Server. ... It is a bug with Beta 2 where the database server is running Windows 2000. ... Server I have the following exception: ... RunBehavior runBehavior, String resetOptionsString) ...
    (microsoft.public.sharepoint.portalserver)
  • return from server only works for built-in types
    ... But when I call _r.GetStatisticsthe client fails with the exception shown ... GetStatistics fails when client and server is on different networks. ... Win32 Version: 2.0.50727.832 ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Sharepoint 2007 - Installation Error - Failed to register SP servi
    ... The issue stems from the installer going to a remote computer for SQL Server. ... Server I have the following exception: ... exception, Boolean breakConnection) ... RunBehavior runBehavior, String resetOptionsString) ...
    (microsoft.public.sharepoint.portalserver)
  • RE: WSE 3.0 errors in event log (may be MTOM related): The value may not be accessed in message stag
    ... Server cannot clear headers after HTTP headers have been sent. ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ... type, HttpContext context, HttpRequest request, HttpResponse response, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)