473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Trying to debug an exception

Hello. Every now and then (it's rare), i get an exception when calling
SqlDataAdapter.Fill. The code is calling a stored procedure and
attempts to stuff the results into a dataset. It yields the following
exception. I am trying to understand what the exception is actually
complaining about. Is it a problem with the data that came back or is
it an issue inside the stored procedure? Any alternative ways to nail
down this issue would also be appreciated.
7/18/2005 4:29 PM System.Data.SqlClient.SqlException: Invalid column
name 'OL_ID'.
at System.Data.SqlClient.SqlDataReader.Read()
at System.Data.SqlClient.SqlDataReader.NextResult()
at System.Data.Common.DbDataAdapter.FillNextResult(ID ataReader
dataReader)
at System.Data.Common.DbDataAdapter.FillFromReader(Ob ject data,
String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at CC.Viper.DataLayer.Database.CreateDataSet(SqlComma nd command) in
C:\Code.Net\Application\Data Layer\Database.cs:line 287
at CC.Viper.DataLayer.Database.GetOrderLines(Int32 inserterID,
DateTime occasionStartDate, DateTime occasionStopDate, Int32&
resultCode, String& resultText, Int32 debugLevel) in
C:\Code.Net\Application\Data Layer\Database.cs:line 764
Nov 17 '05 #1
4 1418
Frank Rizzo <no**@none.com> wrote:
Hello. Every now and then (it's rare), i get an exception when calling
SqlDataAdapter.Fill. The code is calling a stored procedure and
attempts to stuff the results into a dataset. It yields the following
exception. I am trying to understand what the exception is actually
complaining about. Is it a problem with the data that came back or is
it an issue inside the stored procedure? Any alternative ways to nail
down this issue would also be appreciated.


I'd try running SQL Profiler while your program is running - that
should show whether or not an error occurred in the stored proc itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
Frank Rizzo wrote:
Hello. Every now and then (it's rare), i get an exception when calling
SqlDataAdapter.Fill. The code is calling a stored procedure and
attempts to stuff the results into a dataset. It yields the following
exception. I am trying to understand what the exception is actually
complaining about. Is it a problem with the data that came back or is
it an issue inside the stored procedure? Any alternative ways to nail
down this issue would also be appreciated.
7/18/2005 4:29 PM System.Data.SqlClient.SqlException: Invalid
column name 'OL_ID'.
at System.Data.SqlClient.SqlDataReader.Read()
at System.Data.SqlClient.SqlDataReader.NextResult()
at System.Data.Common.DbDataAdapter.FillNextResult(ID ataReader
dataReader)
at System.Data.Common.DbDataAdapter.FillFromReader(Ob ject data,
String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at CC.Viper.DataLayer.Database.CreateDataSet(SqlComma nd command) in
C:\Code.Net\Application\Data Layer\Database.cs:line 287
at CC.Viper.DataLayer.Database.GetOrderLines(Int32 inserterID,
DateTime occasionStartDate, DateTime occasionStopDate, Int32&
resultCode, String& resultText, Int32 debugLevel) in
C:\Code.Net\Application\Data Layer\Database.cs:line 764


Based on the exception I would guess you are selecting 'OL_ID' from your
table which does not exist.

Try running the stored proc/statement through query analyzer or some
such in the same way as your method would be running it.

HTH
JB
Nov 17 '05 #3
Frank Rizzo wrote:
Hello. Every now and then (it's rare), i get an exception when
calling SqlDataAdapter.Fill. The code is calling a stored procedure
and attempts to stuff the results into a dataset. It yields the
following exception. I am trying to understand what the exception is
actually complaining about. Is it a problem with the data that came
back or is it an issue inside the stored procedure? Any alternative
ways to nail down this issue would also be appreciated.


catch the SqlException and view the Errors collection: that's where
the SqlServer responses are stored. Maybe that will give you a lead
as to where the problem really is.

Hans Kesting
Nov 17 '05 #4
Hans Kesting wrote:
Frank Rizzo wrote:
Hello. Every now and then (it's rare), i get an exception when
calling SqlDataAdapter.Fill. The code is calling a stored procedure
and attempts to stuff the results into a dataset. It yields the
following exception. I am trying to understand what the exception is
actually complaining about. Is it a problem with the data that came
back or is it an issue inside the stored procedure? Any alternative
ways to nail down this issue would also be appreciated.

catch the SqlException and view the Errors collection: that's where
the SqlServer responses are stored. Maybe that will give you a lead
as to where the problem really is.

Hans Kesting


Thank you. I didn't realize SqlException had an errors collection.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fabio Papa | last post by:
Hi, I am fairly new to programming and and even newer to dotnet. I appoligise in advance if this is a dumb questions, and I would appreciate if you could answer it anyways. :) I am writing a...
2
by: Debbie | last post by:
Hi I have developed an application that access an SQL database and installed it on a different machine The installation is successful but when I try to run the application I get the following...
2
by: J-T | last post by:
Hi All, We have an asp.net application on a windows 2003 server which is part of a domain controller which my worksatis is too. We have impersonated in our applciation with a fixed identity...
1
by: Fredrik Melin | last post by:
Hi. I have run into trouble, I have a form that many of my forms inherits, the problem is in the IDE I can bring up the Base form into the form editor with no problem, but trying to bring up one...
10
by: Brett | last post by:
For some reason when I step into the code below, it jumps out on the second iteration at the line I have marked below. Nothing else happens - no errors. Dim tcpClient As New...
6
by: tascien | last post by:
Hi guys, here is a puzzling question... I am able to debug my project on my dev server very fine. Now, here is a question: - I set the project to release. I copy the project to the production...
5
by: blackjack2150 | last post by:
Hi. This one is really strange and annoying. The main method of a Windows Application: static void Main(string args) { Application.EnableVisualStyles();...
3
by: Bob Johnson | last post by:
It is my understanding - and please correct me if I'm wrong - that when building a project in debug mode, I can deploy the .pdb file along with the ..exe and thereby have access to the specific...
4
by: skunapareddy | last post by:
I am needing to read a blob from database and pass it to another java program. I researched internet and found a program that reads a file on the client pc and gives bytes, but when I modified the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.