Showing posts with label occured. Show all posts
Showing posts with label occured. Show all posts

Saturday, March 31, 2012

There are so many bugs in the template of "Time Track"

There are so many bugs in the template of "Time Track", an error occured while I want to try delete a project in the project list page.

Error meesage as follows:

Server Error in '/Sample' Application.

Item has already been added. Key in dictionary: 'Id' Key being added: 'Id'

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.ArgumentException: Item has already been added. Key in dictionary: 'Id' Key being added: 'Id'

Source Error:

Line 44: Protected Sub ListAllProjects_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles ListAllProjects.RowDeletingLine 45:Line 46: e.Keys.Add("Id", ListAllProjects.Rows(e.RowIndex).Cells(0).Text)Line 47: Line 48: End Sub


Source File:c:\inetpub\wwwroot\Sample\TimeTracker\Project_List.aspx.vb Line:46

Stack Trace:

[ArgumentException: Item has already been added. Key in dictionary: 'Id' Key being added: 'Id'] System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +2836739 System.Collections.Hashtable.Add(Object key, Object value) +11 System.Collections.Specialized.OrderedDictionary.Add(Object key, Object value) +49 Project_List_aspx.ListAllProjects_RowDeleting(Object sender, GridViewDeleteEventArgs e) in c:\inetpub\wwwroot\Sample\TimeTracker\Project_List.aspx.vb:46 System.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e) +133 System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +604 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1155 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +199 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

When you add a item to a HashTable you can't have the same key, in your case all items that will be added to your Hashtable will have the "Id" as a key, make sure the key value is unique.
I knew the database constraint. I just want to say the "Time Tracker" has many bugs. Because I have not change anything in the project list page and database object.

Tuesday, March 13, 2012

Thread was being aborted thrown for background thread (win2003 ser

Hello,
Thread was being aborted exception is thrown by IIS for my asp.net
application on win2003 server. This error has not yet occured with the same
asp.net application on
windows 2000 professional computers that are also lot older and less
effective. And this error does not occure if this thread is run by console
application.
This asp.net gui application starts a background thread that mainly
reads data from ms access database (approximately 0,5 GB access db)
with oledb connection and then calculates something and writes to
another database.
I have tracked down that this exception is thrown by IIS in the
following code when the dataadapter should be filled with data from ms
access database or at least it seems that way after running three test trial
s.
OleDbDataAdapter dataadapter = new OleDbDataAdapter(command);
DataSet ds = new DataSet();
dataadapter.Fill(ds);
And this code should be totally OK as such since the same method is
run about thousand times before this exception is thrown and the
thread is terminated.
Has anyone run to same kind of problem ?
There are many questions in these newsgroups about direct and transfer
commands sending thread was being aborted, but this is not a case for
which that situation would apply. This is a new thread created by the
asp.net code and should run until the operation is finished, but does
not do that right now.
I read that IIS could unload application domain by throwing this
exception if it thinks that a crash,timeout,deadlock or memory has
been exceeded. But this should not do that since console application
on the same win2003 server runs just fine and on slower and older
win2000 machines the application also performs okey on IIS.
Also tried to change connection timeout parameter of IIS server, but
it did not help (from 120 to 1200)
Thank you in advance for reading and for possible answers that might
help me to figure a way out of this problematic situation.
BR,
JohannaWhat happens if you run this as a single thread?