The thread runs intermittently every 3 seconds. Suppose the program is running in the background. If I want to create / update / delete data on the sql server, the datatable is updated?
using (SqlConnection cn = new SqlConnection()) { cn.ConnectionString = @"Data Source=****;Initial Catalog=***;User ID=****;Password= ***"; cn.Open(); using (SqlDataAdapter adapter = new SqlDataAdapter("SELECT s.id as shedule_id, s.name_ru as shedule_name_ru, s.sendType as shedule_sendType, c1.cod as typsendtype , s.typPeriod, c2.cod as time_name_ru, s.metaAlg, m.cod as meta_cod, s.dt_send, s.dt_beg as shedule_dt_beg, s.dt_send_daytime as shedule_dt_send_daytime, s.dt_period_end as shedule_dt_period_end FROM Shedule s inner join ClBaseItem c1 on s.sendType=c1.id inner join ClBaseItem c2 on s.typPeriod=c2.id inner join MetaAlg m on s.metaAlg=m.id", cn)) using (DataTable dt = new DataTable()) { adapter.Fill(dt); What should I write to update datatable?
The program runs in the background.
public static void one(object state) { // тут надо писать }
shedule. - propro17datatable. And periodically the timer checked that the change was / was not on the table - propro17