asp.net - Building an import process that checks for duplicates -


using asp.net, i'm building admin tool requires function import list of email addresses. upon uploading file, want check existing records of email addresses supplied. non-existing email addresses, create them using dao.

basically want to:

  1. receive list of emails
  2. retrieve data existing emails
  3. create data new emails in db
  4. return full data emails in list.

since want know of emails exist front, first thought query table records where email in ('email001fromfile', 'email002fromfile', 'etc...') list potentially contain thousands of email addresses, , i'm not supplying many email addresses in operator idea.

i thought looping through list , checking record each email, potentially generate far many queries.

my next thought generate temp table hold list , modify in clause use temp table, rather explicit list of items, require execute sql or stored procedure directly, i'm not inclined since i'm using nhibernate access db.

though using asp.net (c#) , nhibernate, , answers specific helpful, i'm looking general ideas on how handle scenario.

if loading existing e-mails memory not option maybe go kind of batch approach. go in-query mention, n emails @ time. eiter hardcode n value or let function of total number of new e-mails.

i'm not sure whether approach faster perform 1 single in-query (someone more db-skills me have answer that), allow indicate kind of loading status user.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -