Diffrence Between Bug And Exception?
Dec 11, 2010In general I want to know what is the difference between bug and exception? If I need to be specific for a particular framework then I would like to go with .Net.
View 2 RepliesIn general I want to know what is the difference between bug and exception? If I need to be specific for a particular framework then I would like to go with .Net.
View 2 Repliesthere is file>new>web ste and file>new>project>web application part. what is web application.i open always web site. what is the the difference of them
View 3 RepliesWhat is the diffrence between the GZipStream, and the DeflateStream?
could somebody explain it with an example by words??
Can any one can describe the main diffrence between the array and generic list.
View 6 Repliesi need to restore Database.mdf; I create a blank new database exactly the same name as the .mdf file. However, I could not restore the database.
The error message prompted was:
TITLE: Microsoft SQL Server Management Studio Express
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
ADDITIONAL INFORMATION:
Cannot open backup device 'C:inetpubwwwrootTCPSystemApp_DataDatabase.mdf'. Operating system error 32(error not found).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)
click: [URL]
BUTTONS:
OK
I am working on a 3-tier asp.net application. Currently I'm stuck up in a situation where I need to handle a specific type of exception (User Defined) in DAL and Show alert to the user if that exception occurs in DAL.
I tried following things:
1) I raised that exception from the DAL and catch it in BLL and throw a new BLL exception to for that DAL exception and finally catch it in the UI layer to show the alert to the user. I've successfully implement this in my project. But there are some issues in this approach. First of all I feel this is not right way to do this as it may lead to performance related issues. Secondly, the application contains more than 500 pages and classes. so I need to attach additional catch block in every method to catch the BLL exception. which is the last option i'd like to take.
2) in second approach I logged the the DAL exception into a text file. but problem in this approach is that how could the UI layer know that exception has occurred and show the alert to the user. Is there any event in asp.net where i could handle all this activities?
my question is what is the best approach to handle this type of situation? Will Exception handling block help me in this?
I've tried reading many articles on this but i couldn't get an answer for my question? I might not be using right keywords for my search.
In ASP.NET,How can i know the Specific details about an exception (like What kind of Exception it is (FileNotFound /Arithmentc etc..) )from a General Exception class object.
View 2 Repliesi have this application structure:
1. Presentation Layer which calls
2. Business Logic Layer which in turn calls
3. Data Access Layer to do the dealing with the database.
Now i have a Contacts page from where i can add a new contact to the database.So to add a New Contact i fill in all the required details and then call a Add Method (residing in the BLL) from the page, which in turn call a Add Method residing in the DAL.this method in the DAL returns the Current Identity of the record which is then return back to the BLL method and finally delivered on the page.this is fine. but what if a get an exception how do i handle it properly because the method in DAL has a return type of int and i dont want to throw another error!! coz other wise i will have to write try catch in almost all the methods.
//something like this
public int AddMethod(ContactClass contactObj)
{
int result = 0;[code]...
rather i want to show the user a user-friendly message which they can easily understand and in the mean while i will send a mail to myself documenting the Error that just occurred.how can i implement my custom exception classes.
Is there any way to uniquely identify a particular exception from the general exception class.
i.e any property or method that retrieves a unique identifier that to identify a particular exception.
I have kept some error values and corresponding error texts in an xml file. I want to read that xml file and have to taken the error ids and fix the corresponding texts to a label. in the case of a system exception we have to identify a particular exception.
Difference between Exception and Fault Exception..?
Can i use Fault Exception when i get the Exception.
We're getting this InternalSubStringWithChecks exception with our application's healthMonitoring. This exception is like the Padding is invalid and cannot be removed exception where it's being recorded and we're getting a notification email but the end user is unaware that an actual error has happened. Though we don't want our event log filled up with this rubbish! The stack trace is:
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest
[code]...
I have simple 3 tier web application and have mostly CRUDE functionalities. Recently I required to add new console application to the existing solution in which I call data layer methods for retrieving data from DB but I get an exception "The type initializer for threw an exception."When I debugged I found that the exception is thrown at datalayer on first line of class where I get connectionstring from
web.config, the code is public static readonly string CONNECT_STRING =
ConfigurationManager.ConnectionStrings["DbConnectString"].ConnectionString;
Now if I hardcode the connection string value like public static readonly string CONNECT_STRING = "Data Source=XYZ;uid=sa;password=XXX;initial catalog=ABC;"
it works fine.I don't understand what is the issue here as web application works fine with this datalayer.
how to handle the Exception
View 9 RepliesPanel pnl_Confirmation = (Panel)form1.FindControl("ConfirmationPanel") as Panel;
pnl_Confirmation.Visible = false;
I keep getting a "NullReferenceException" in the above code. "ConfirmationPanel" is a panel I show/hide depending on if the form is submitted successfully or not.
The panel is wrapped in a LoginView control, which is why I cannot call "ConfirmationPanel" directly:
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<asp:Panel id="ConfirmationPanel" runat="server" Wrap="False">
...
Why is this null? It should be referencing the Panel with the ID "ConfirmationPanel", no?
The following is a web method that is called from ajax, I have verified with firebug that the script is indeed passing two string values to my method:
public string DealerLogin_Click(string name, string pass)
{
string g="adf";
if (name == "w" && pass == "w")
{
HttpContext.Current.Session["public"] = "pub";
g= "window.location = '/secure/Default.aspx'";
}
return g;
}
I'm passing "w" just for testing purposes. If I delete the if block then I don't get an error back from the server. I'm confused.
I created a simple data access layer in the dll and reference it in my web app. How can I point the error to the user that his code in this line has an exception. currently, when i input a nonexisting table it will popup an error "invalid object name table_name" and points the my code throw exception inside my dll. I want it to point out to the user code that uses my function that creates an error.
Line 92: Dim ds As DataSet = DAL.Dal.ExecuteDataset("SELECT * FROM table_nam", "DBConnectionString")
Line 93: GridView1.DataSource = ds.Tables(0)
We have a dataset dsActualCost which fetches query value: MonthName in one column and Cost in another.
We have a code to display data in table format.
For MonthIndex = 0 To dsMonth.Tables(0).Rows.Count - 1
Dim tdMonthlycost As New TableCell
If dsActualCost.Tables(0).Rows.Count > 0 Then
[code]...
I am trying to catch an exception but occasionally get an inner exception. I want to output both into a label. I often get Object reference not set to instance of an object if there is no inner exception.
Catch ex As Exception
exError = ex.Message.ToString
If Not ex.InnerException.Message Is Nothing Then
exError &= "<br/>" & ex.InnerException.Message.ToString
End If
Return View()
End Try
when inserting (save )it gives this error could not get or update next value[SQL: ]
inner exception
{"Invalid object name 'hibernate_unique_key'."}
As far as I can see, whenever a filter's OnActionExecuted is called, it might be after an exception has been thrown futher down the request processing pipeline. So surely this means that one should always be checking to see if there's an exception in the filter's context within an implementation of OnActionExecuted?
Isn't this like pre-exceptions error handling where one would have to, say, check the result of a method call to determine if there'd been an error - of course opening up the possiblity that one might forget to do this?
I'm handling exceptions in the Application_Error() method in Global.asax but ex.Source is not giving me much. I want to know where the error occured i.e. /folderName/pageName.aspx.
Also I use lots of user controls so getting aspx name may not even be enough. Is there a way to get the name of object where the exception occured i.e. class name, user control name, etc.
What is the point of throwing an exception? It it anyways going to be caught in the Global.asax Application_Error method.
Lets say in the following code we throw an exception.
try {
using (var dc = GetDataContext())
{
// We are doing some data inserts here.
}
catch ( Exception ex)
{
throw ex;
}
My Question: Even if we do not use try catch and throw here, any exception which will be raised here will be caught inside Application_Error method in Global.asax. Then what is the point of try, catch and throw in this case?
I'm developing a .NET application using .NET 3.5 .My application is using a JAVA
WebService (wsdl url)
When I run the application I want to consume the web service (wsdl file) written in XML. i either keep getting the Operation Time out Error or the following exception while debugging
Possible SOAP version mismatch: Envelope namespace
http://schemas.xmlsoap.org/wsdl/ was unexpected.
We have a web application based on asp.net 1.1. We deployed it on a web server but there is a problem about it. In the webserver sometimes cpu usage is increasing to 100% and outofmemory exception is occuring.
I think there are some wrong code inside the project but i don't know where it's.
Now, i want hear your advices about how to find problem and what kind of codes make cpu usage increased.
My application is a survey application and I am using asp.net 2.0 and sql server 2005 version. There are many users taking survey at a single point of time. Some times delock is coming at a single method where i am deleting some records in a loop one by one(This delete statement may be executed for about 20 question in a page). This is a simple delete statement as below
delete table_name where column_name1='' and column_name2=''
column_name1 has foriegn key constraint, column_name2 also has foriegn key constraint.
The exception is as below.
Transaction (Process ID 204) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction