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();
}
}

Akshay PhadkeRank #161 · 14.6K reputationPosted Jul 1, 2016, 11:57 PM EDT
db.SubmitChanges();
Ankur Goel75 reputationPosted Aug 8, 2016, 12:51 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 8, 2016, 1:23 PM EDT