exception

System.Drawing.Icon constructor throwing "Operation completed successfully" exception

On a Windows XP machine, the following code is throwing a System.ComponentModel.Win32Exception with the message "The operation completed successfully" System.Drawing.Icon icon = new System.Drawing.Icon("icon.ico"); I can stop the program crashing with try { System.Drawing.Icon icon = new System.Drawing.Icon("icon.ico"); } catch(S...

WPF DataTemplate not throwing exception

While designing a new WPF application I noticed exceptions not being thrown during data binding for controls with DataTemplates. To test I wrote the following simple user control with as little logic as possible. I'm using .NET 3.5 SP1, VS2008 SP1 running on WIN7. When the DataContext is set, TestMethod is called and an exception is t...

linq-to-sql: Stored procedures cannot be used inside queries.

This fails on VS2010 RC LINQ-to-SQL with the InvalidOperationException "Stored procedures cannot be used inside queries.": var foo = (from a in aTable from b in this.SomeStoredProcedure() where a.Id == b.Id select b.Id); SomeStoredProcedure is a SQL procedure which returns a table. 'join' also appears to fail. Any thought...

C++ Exceptions questions on rethrow of original exception

Will the following append() in the catch cause the rethrown exception to see the effect of append() being called? try { mayThrowMyErr(); } catch (myErr &err) { err.append("Add to my message here"); throw; // Does the rethrow exception reflect the call to append()? } Similarly, if I rewrite it this way, will bit slicing occur if ...

Handling response.redirect errors in JSP page

Hi i have a condition where an URL is manipulated or changed wantedly. i have to catch the error and move to error page. but the error page is never called. I am using response.sendRedirect("MyURL"); in the jsp page. If the URL is correct its working fine. If i manipulate the URL and use the command it shows HTTP 404 error in the s...

using System.Windows.Forms.Datagrid

Coding on Visual C# since a few days ago. Trying to access the elements in a DataGrid using the following code private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { textBox2.Text = this.dataGridView1.SelectedCells().Value; } Throws the next exception Non-invocable member 'System.Windows.Form...

System.AccessViolationException when calling C++ from C#

Hello, I don't know why but today myOpenID doesn't seem to work. Anyway ... I have this problem: I have a unmanaged C++ library (DLL) which I have to embed in an existing C# project. Now ... I have created a mini-wrapper (DLL) in managed C++ which calls the library so that I can load it from the C# code and, when I try it from a command-...

Input stream iterators and exceptions

I was playing around with istream iterators and exception handling a few days ago and I came across with this curiousity: #include <iostream> #include <fstream> #include <iterator> #include <algorithm> using namespace std; int main(int argc, char* argv[]) { if (argc < 2) { cout << argv[0] << " <file>" << endl; return -1...

There is no source code available for current location - the input string was not in the correct format

Hi In my main window code behind i set the datacontext to an observable collection which is populated with a call to my database. If there are records to be returned everything runs fine. When there are no records i get the error. There is no source code available for current location and then another window opens with the heading Fo...

Java Exception Naming Conventions

In Java, is there a semantic difference between using "Illegal" (as in IllegalArgumentException) versus "Invalid" (as in javax.activity.InvalidActivityException)? During the course of an assignment it became useful to write a subclass of IllegalArgumentException to represent a series of input characters that cannot be tokenized, and I'...

confirm behavior of exception and implications for objects

I just want to confirm my understanding of exceptions and how they impact their objects. If I throw an exception, that halts the processing of a method, correct? So there's no point in doing if ( some_check() ) { throw new Exception(...); } else { ... } I should just do this if ( some_check() ) { throw new Exception(......

Custom Elmah YSOD data

I'm using Elmah with ASP.NET and wondering how I would add custom data, such as a session variable, to an unhandled exception email. I've tried several handlers in the Global.asax file but can't seem to find the right one. ...

Exceptions in native PHP functions

Hi guys :) Most functions in PHP returns true/false: var_dump (is_int ("1")); // false Can I configure PHP to return exceptions instead of boolean ? try {is_int ("1")} catch (Exception $e) {exit ($e->getMessage ());} Thanks. ...

An unhandled win32 exception occurred in MyApp.exe

WinXP used. When I click the default cross icon to close my application. The win form of my application disappeared, but MyApp process still alive in the processes list when I open the task manager window. About 5 seconds later, throw out the unhandled win32 exception error. Where can I set the break point? I don't know how to debug it...

Axis2 WebService and multiple ExceptionFault elements in WSDL

Hi! I am not AXIS2 expert, therefore I am using Eclipse to generate bottom - up webservice. I am publishing 2 methods as webservices. These methods are defined to throw java.lang.Exception in order to produce SOAPFault when calling webservice that ends with exception. public class sample { public String someMethod() throws Exception ...

Placing exceptions in their own subpackage?

In the current package that I am working on for a project I have about 13 different custom exceptions. Is it a good idea to place these into their own subpackage below the package that has all the classes that will be using these exceptions? For example: com.company.project.core contains a bunch of classes which can throw some cus...

Is there any advantage to use spring DataAccessExceptions instead of JPA PersistenceExceptions ?

I'm using JPA in my DAOs outside of Spring . The Spring framework defines DataAccessExceptions that are independent of databases implementations. Is there any advantage for a non Spring user to use the Spring data access exceptions instead of those of JPA ? I guess that the Spring DataAccessExceptions exist since Spring handle several u...

Android, Client-Server app, Bad Socket Exception

I have a simple client-server app on android. the android service communicates with the server via tcp sockets. the service sends a simple String to server which works. the server processes the string and sends back an object to the android service. the object implements the serializable interface. the object "leaves" the server successf...

Problem with VB .Net 08 ConfigurationErrorsException was unhandled error

Hi there friends I'm doing a project for partial fulfillment of my under graduation. In the program the front end is VB >net 08 and back end is MS Access. The problem is ConfigurationErrorsException was unhandled error. My project is based on gas agency. In this project I take 3 input from user for adding customer details , gas booking a...

WPF: System.ArgumentException => {"'{0}' is not a Visual or Visual3D."}

Hello, when I d*ouble-click* - or click once when its already focused - below the items in a empty area of the Listbox which is within my DataGridTemplateColumn then I get the above error message. WHAT do I wrong? This is my Code: <DataGridTemplateColumn Width="0.3*" Header="Attachments"> <DataGridTemplateColumn.CellTemplate> ...