473,725 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Sql Client.SqlExcep tion: Invalid column
name 'OL_ID'.
at System.Data.Sql Client.SqlDataR eader.Read()
at System.Data.Sql Client.SqlDataR eader.NextResul t()
at System.Data.Com mon.DbDataAdapt er.FillNextResu lt(IDataReader
dataReader)
at System.Data.Com mon.DbDataAdapt er.FillFromRead er(Object data,
String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords, DataColumn parentChapterCo lumn, Object parentChapterVa lue)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
at CC.Viper.DataLa yer.Database.Cr eateDataSet(Sql Command command) in
C:\Code.Net\App lication\Data Layer\Database. cs:line 287
at CC.Viper.DataLa yer.Database.Ge tOrderLines(Int 32 inserterID,
DateTime occasionStartDa te, DateTime occasionStopDat e, Int32&
resultCode, String& resultText, Int32 debugLevel) in
C:\Code.Net\App lication\Data Layer\Database. cs:line 764
Nov 17 '05 #1
4 1440
Frank Rizzo <no**@none.co m> 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.co m>
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.Sql Client.SqlExcep tion: Invalid
column name 'OL_ID'.
at System.Data.Sql Client.SqlDataR eader.Read()
at System.Data.Sql Client.SqlDataR eader.NextResul t()
at System.Data.Com mon.DbDataAdapt er.FillNextResu lt(IDataReader
dataReader)
at System.Data.Com mon.DbDataAdapt er.FillFromRead er(Object data,
String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords, DataColumn parentChapterCo lumn, Object parentChapterVa lue)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
at CC.Viper.DataLa yer.Database.Cr eateDataSet(Sql Command command) in
C:\Code.Net\App lication\Data Layer\Database. cs:line 287
at CC.Viper.DataLa yer.Database.Ge tOrderLines(Int 32 inserterID,
DateTime occasionStartDa te, DateTime occasionStopDat e, Int32&
resultCode, String& resultText, Int32 debugLevel) in
C:\Code.Net\App lication\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
2641
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 windows service wich sends emails to customers at a specific time. My app retrieves cities and the city's associated time from a database, waits until the specified time for each city and sends out the appropriate emails. Below is some code that is...
2
2214
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 error Application has generated an exception that could not be handled Process id = 0x610 (1552), Thread id=0x1d0(464)
2
1747
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 account which is also a domain account and is part of the admininstrator group of the webserver.The application is set to use NTLM and its application pool's IDENTITY is also set to use that imperssonated account,when I try to browse the application...
1
978
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 the forms that inherites the base give an exception in the IDE. The type initializer for "DacsaNET.Generic_Module" threw an exception. The problem is that the IDE does not give me an line number or anything to
10
1912
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 System.Net.Sockets.TcpClient tcpClient.Connect("127.0.0.1", 9005) While True Dim networkStream As NetworkStream = tcpClient.GetStream()
6
2576
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 server. - the project has a problem on the production server. - How do i debug it? Should I install visual studio on the production server? how do i step through the code on the production server? It gets so difficult to
5
1835
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(); Application.SetCompatibleTextRenderingDefault(false); try
3
15516
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 line number of code that throws an exception. Specifically, I can have an error logging routine that, amongst other things parses the call stack and tells me the specific line of code that choked. It is also my understanding that if building in...
4
4252
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 code to read a blob from DB I am not having any luck, I am running this java programs using JDEVELOPER. Can anyone please give me some help? The code is as follows: ... private static byte getBytesFromBlob(Blob blob) throws Exception { ...
0
8886
marktang
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...
0
8750
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,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9256
jinu1996
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...
0
8091
agi2029
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...
1
6701
isladogs
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...
0
6010
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();...
0
4509
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...
3
2154
bsmnconsultancy
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...

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.