![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to run a query from a C#.NET application using the standard SqlClient connected to a SQL2005 database. Basically the query is: select count(*) from table1 where column1 is not null or column1 > 0 table1 exists and contains a column named column1. column1 is an int datatype and allow nulls. If I run the query from a query window in the SQL Server Management Studio, it runs just fine. However if I run it from the C#.NET app, the ColumnIndexOutOfRangeException is being thrown. The message text is "index was outside the bounds of the array". Any ideas? |
#3
| |||
| |||
|
|
On Jul 23, 6:25*pm, Joe Cool <joecool1... (AT) live (DOT) com> wrote: I am trying to run a query from a C#.NET application using the standard SqlClient connected to a SQL2005 database. Basically the query is: select count(*) from table1 where column1 is not null or column1 > 0 table1 exists and contains a column named column1. column1 is an int datatype and allow nulls. If I run the query from a query window in the SQL Server Management Studio, it runs just fine. However if I run it from the C#.NET app, the ColumnIndexOutOfRangeException is being thrown. The message text is "index was outside the bounds of the array". Any ideas? Well, now I am not sure if this a problem or not. Actually, I was seeing this in a VB.NET program that I am converting to C#.NET. This app produces a report based on the content of a database. I wanted to generate the report with the VB version so I could make sure the output of the C# version was identical. I now have the C# version in testing mode and I am not getting this error with it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |