473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to check Internal and External duplicates?

Recently, I have a requirement to develop a vb.net application wherein the input excel sheet data which has an average of 5000 records should be checked for Internal duplicates (duplicates within the same sheet) and external duplicates (duplicates which exist outside this sheet). I have gone through lot of logics..some of which are ...

- Common and currently testing out..

- First insert the excel sheet data into DB..then query by following

Expand|Select|Wrap|Line Numbers
  1.    select distinct id,mobilenumber from scrubmaster where calltablename=<calltablename given by the uploader> 
Then loop for duplicates...

Expand|Select|Wrap|Line Numbers
  1.   For jj As Integer = 0 To ds3.Tables("dup").Rows.Count - 1
  2.  
  3.             stor1 = "SELECT count(mobilenumber), calltablename from scrubmaster WHERE mobilenumber =<mobilenumber> and flag is NULL GROUP BY calltablename"
  4.             da3 = New OleDbDataAdapter(stor1, con3)
  5.             da3.Fill(dse3, "dupp")
********* internal duplicates logic **************

Expand|Select|Wrap|Line Numbers
  1.             If dse3.Tables("dupp").Rows(0).Item(0) > 1 Then
  2.                 dupcountid += 1
  3.                 stor2 = "update scrubmaster set flag='ID' where ID=" & ds3.Tables("dup").Rows(jj).Item(0) & " and flag IS NULL"
  4.                 comm.Connection = con3
  5.                 comm.CommandText = stor2
  6.                 comm.ExecuteNonQuery()
  7.                 stor2 = ""
  8.             End If
********* External duplicates logic **************

Expand|Select|Wrap|Line Numbers
  1.             If dse3.Tables("dupp").Rows.Count > 1 Then
  2.                 dupcounted += 1
  3.                 stor2 = "update scrubmaster set flag='ED' where ID=" & ds3.Tables("dup").Rows(jj).Item(0) & " and flag IS NULL"
  4.                 comm.Connection = con3
  5.                 comm.CommandText = stor2
  6.                 comm.ExecuteNonQuery()
  7.                 stor2 = ""
  8.             End If
  9.             stor1 = ""
  10.                     Next
The above logic works but it takes very long time..I have tried other logics from web but they "Query timeout"...

Any good logic pls or correct my logic?
Aug 24 '09 #1
1 2121
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Aug 24 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: qazmlp | last post by:
const has internal linkage in C++, but external linkage in C. Am I right ? But, linker reports multiply-defined error if the following header is included in multiple .cpp files. //...
1
by: Razvan | last post by:
Hi What is the difference between an internal and an external entity ? The first one is defined in the internal subset (not in a separate DTD file, but in the XML file itself - in...
6
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
5
by: Mr. B | last post by:
The following code is how I check for duplicates in a List box. This is simple enough as there is only one column of stuff to check. ' Check for Duplicates ' Search listbox (from last to first)...
8
by: Carlos J. Quintero | last post by:
Hi, As you know the current keywords "protected internal" (C#) or "Protected Friend" (VB.Net) means "Protected Or internal" (C#) or "Protected Or Friend" (VB.Net), that is, the member is...
3
by: al.cpwn | last post by:
do static and inline functions or members have internal linkage? I have been reading this newsgroup on google and found conflicting ideas. Can someone please help me understand why in some places...
1
by: Daniel Di Vita | last post by:
I have an application that needs to pull files from an internal server. This is the setup. The web server is external facing, meaning exposed to the internet. I then have a file server that sits...
2
by: Gnus | last post by:
Hi all! I have a little(?) problem with external schema location... I'm using xerces/xalan (C++) for doing some actions with some set of xml-files. Some of these files must validating...
1
by: =?Utf-8?B?VCBSYXkgSHVtcGhyZXk=?= | last post by:
I have an ASP.NET 2.0 web app using forms authentication and an ASP.NET Membership database. Internal users access the app from the intranet, but they are authenticated by the membership module....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.