error with zip code radius/distance

liunx

Guest
I have the companys website that i work for up and running locally...we want to get everything working completely locally just incase....
anyways...try to make a long story short:
i have copied all the source files and recreated the sql db exactly....and it all is working great.
on our search page we have a way to search by zip code and narrow down by distance.
(please remember, this site was up long before i started here)
the search page is a aspx script...but i also see a cs and js file for the zip code radius search
the search works but if i choose a distance it bombs
heres the main url <!-- w --><a class="postlink" href="http://www.ihplan.com">www.ihplan.com</a><!-- w -->
this is what i get :

Server Error in '/' Application.
--------------------------------------------------------------------------------

Item has already been added. Key in dictionary: "33706" Key being added: "33706"
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: "33706" Key being added: "33706"

Source Error:


Line 386://sWhere += "'" + thisRow["ZipCode"] +"', ";
Line 387:sWhere += "Zip LIKE '" + thisRow["ZipCode"] +"%' OR ";
Line 388:ZipAndDistance.Add(thisRow["ZipCode"],Distance);
Line 389:
Line 390:}


Source File: C:\Inetpub\ihplan\hospital_results.aspx Line: 388

Stack Trace:


[ArgumentException: Item has already been added. Key in dictionary: "33706" Key being added: "33706"]
System.Collections.SortedList.Add(Object key, Object value) +221
ASP.hospital_results_aspx.GetZipCodeInRadisExpression(String ZIPCode, Int32 radius) in C:\Inetpub\ihplan\hospital_results.aspx:388
ASP.hospital_results_aspx.GetQP() in C:\Inetpub\ihplan\hospital_results.aspx:253
ASP.hospital_results_aspx.GetHospitals() in C:\Inetpub\ihplan\hospital_results.aspx:282
ASP.hospital_results_aspx.Page_Load(Object sender, EventArgs e) in C:\Inetpub\ihplan\hospital_results.aspx:202
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +720




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573-Key in dictionary: "33706" Key being added: "33706"
-Exception Details: System.ArgumentException


Line 388:ZipAndDistance.Add(thisRow["ZipCode"],Distance);
Line 389:
Line 390:}



can u check that code? seems thats where the problem come from...
if i'm not mistaken, i think ZipAndDistance is a object off some class and the Add is the method? u may wanna review that class to make sure all the logic is good to go.

u mentioned this program was been around for a long time, i got a feeling that method was meant for the last application, and u need additional modification to fit ur current application.

hope that helps
 
Back
Top