Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
data continuously inserted in table
scropio gurl
Jul 1 2016 8:11 AM
294
Reply
I try to send data in table when time exceed over 5 mint data is inserted successfully but data insert multiple times i want to submit data only one time
i.e. only one row insert for 1 number
this is what i try
if
(timediff.TotalMinutes > 5)
{
DataClasses1DataContext db =
new
DataClasses1DataContext();
var u = db.tbl_urgent_contacts;
foreach
(var a
in
u)
{
tbl_OutBox tb =
new
tbl_OutBox();
tb.FromSIM_No = a.SimNo;
tb.ToSIM_No = a.SimNo;
tb.ToText =
"Check abc"
;
tb.Reply =
"NA"
;
tb.Response =
"NA"
;
tb.RegNo =
"NA"
;
tb.Datetd = DateTime.Now;
tb.FFID =
"NA"
;
tb.UserId =
"You"
;
tb.FromText =
"Check abc"
;
db.tbl_OutBoxes.InsertOnSubmit(tb);
db.SubmitChanges();
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Which one is better in "LINQ to SQL" and "LINQ to Entity"??
Data continuously inserted in table