data continuously inserted in table
i.e. 1 row insert 1 number
try
if (timediff.totalminutes > 5)
{
dataclasses1datacontext db = new dataclasses1datacontext();
var u = db.tbl_urgent_contacts;
foreach (var 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();
}
}
maybe exclude existing entries this:
var u = db.tbl_urgent_contacts.where( … );
the “…” condition depends on details of tables , include ‘!db.tbl_outboxes.contains(…)’ expression, etc.
another solution remove processed entries tbl_urgent_contacts if no more needed, or add additional column (bit, boolean), called processed example. have:
var u = db.tbl_urgent_contacts.where( c => ! c.processed );
foreach (var in u)
{
a.processed = true;
. . .
}
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment