TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hasibul Kamel
NA
44
4.3k
new records added in csv
Sep 2 2020 1:39 AM
Hi, I need help on how to update to the database if there are new records added in CSV file.
If only 3 new records added in the CSV file, only insert those 3 new records, not all records.
if
(LWT > 0)
{
Console.WriteLine(
"There are no changes in lastWriteTime CSV file"
);
}
else
{
Console.WriteLine(
"There are changes lastWriteTime in CSV file"
);
var lf2 = "insert into
listfile(filename,lastwritetime)values(@filename,@lastwritetime)";
var cmd3 =
new
NpgsqlCommand(lf2, conn);
cmd3.Parameters.AddWithValue(
"filename"
, Convert.ToString(file));
string
filename = cmd3.Parameters[
"@filename"
].Value.ToString();
Console.WriteLine(
"Record inserted successfully. filename = "
+ file);
}
Reply
Answers (
1
)
How to convert Data table into this csv format
How to make normal sql query to dynamic sql query?