U
Uri Dor
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?
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?