|
-
Oct 22nd, 2008, 01:56 PM
#1
Thread Starter
Addicted Member
[2005] ASP.NET and Excel
Hi all,
I "inherited" an ASP.NET page that reads in an excel sheet. However, I want to know the most effecient way to check for duplicate rows.
I was told I should sort the spreadsheet by a unique column, and then do my comparison. I would then compare the first row to the 2nd row, the 2nd row to the third row, and so on. I need to handle about 10,000 rows at once. Therefore, I am very concerned about timeout issues.
Is this the right approach? And if so, what resource can I look at to get started on it. If it's not the right approach, can someone give me an idea of what would be best?
Thanks
If my post helped you, please rate it!
Languages: VB/ASP.NET 2005, C# 2008,VB6
Databases: Oracle (knowledge not currently in use), DB2
FROM Customers
WHERE We_Know_What_We_Want <> DB.Null
SELECT *
0 rows returned
-
Oct 22nd, 2008, 02:16 PM
#2
Re: [2005] ASP.NET and Excel
 Originally Posted by Blakk_Majik
I was told I should sort the spreadsheet by a unique column, and then do my comparison. I would then compare the first row to the 2nd row, the 2nd row to the third row, and so on.
That actually wouldn't find duplicates unless they were next to each other. The way that should have been explained would be "compare the first row to the 2nd row, the 1st row to the 3rd row, etc).
Now on to the problem at hand. Do you have any control over how or when the data is loaded? If so then this can easily be solved by calling a different SQL query (if it's SQL) and doing a DISTINCT. If you don't have control over it, then what is it being loaded into? A DataGrid? If it's a DataGrid you may be able to do a SQL query into it with DISTINCT.
Other than that I'm not sure of a more efficient way. I like to take care of this before the data hits the application.
-
Oct 22nd, 2008, 02:43 PM
#3
Thread Starter
Addicted Member
Re: [2005] ASP.NET and Excel
When a user uploads a spreadsheet, it is held in a temporary folder while the application reads it. Once the application is done reading the data, the sheet is deleted from the temporary folder and the collection of data from the sheet is bound to a datagrid.
If my post helped you, please rate it!
Languages: VB/ASP.NET 2005, C# 2008,VB6
Databases: Oracle (knowledge not currently in use), DB2
FROM Customers
WHERE We_Know_What_We_Want <> DB.Null
SELECT *
0 rows returned
-
Oct 23rd, 2008, 04:33 AM
#4
Re: [2005] ASP.NET and Excel
Might be faster if you read from the Excel file (as a data source) into a dataset, then loop through the dataset instead.
-
Oct 23rd, 2008, 08:46 AM
#5
Thread Starter
Addicted Member
Re: [2005] ASP.NET and Excel
Do you know of any resources I can look at to do what you suggested?
If my post helped you, please rate it!
Languages: VB/ASP.NET 2005, C# 2008,VB6
Databases: Oracle (knowledge not currently in use), DB2
FROM Customers
WHERE We_Know_What_We_Want <> DB.Null
SELECT *
0 rows returned
-
Oct 24th, 2008, 04:27 AM
#6
Re: [2005] ASP.NET and Excel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|