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.2k
insert csv base on line
Sep 9 2020 1:27 AM
Hi, need help, how to insert into the database based on the last row in CSV. for example, I have 500 lines, all 500 lines already insert into the database. How to do if the row change to the 501 lines and the insert start from line 501. I want to replace it from delete, to insert from line 501. Help me please
if
(LWT > 0)
{
Console.WriteLine(
"There are no changes in lastWriteTime CSV file"
);
var del1 =
"delete from result"
;
var cmd11 =
new
NpgsqlCommand(del1, conn);
cmd11.ExecuteNonQuery();
}
else
{
Console.WriteLine(
"There are changes lastWriteTime in CSV file"
);
var lf2 =
"insert into listfile(filename)values(@filename)"
;
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
)
Convert List to IList<T>
learning selenium test auto framework