i have two database now i have to insert data from one db to another db in loop. i know bit sql bulk copy and i do not know how to insert one data at a time using sql bulk copy.
here is my table structure
CREATE TABLE [CandidateApplication](
[EmailID] [varchar](300) NOT NULL,
[Name] [varchar](300) NULL,
[FileName] [varchar](500) NULL,
[IsDownloaded] [bit] NOT NULL
)
basically i need to fetch data from one db with clause like IsDownloaded=0
and then i need to iterate in loop. with in loop i will get file path from FileName
field and download that file. if the file download successfully then i have to save that data from db1 to db2 and update field IsDownloaded=1
to db1.
can i handle the data insert from one db to another db with in loop using sqlbulk copy class. please suggest. thanks