C#WinForm中如何实现指定目录下指定时间段内的SQL数据内容的删除? 20
如上面图片所示,如何实现在给定的时间段内删除指定的目录树下的数据?读取目录树的源码如下:privatevoidShowDataWithTreeView(){try{for...
如上面图片所示,如何实现在给定的时间段内删除指定的目录树下的数据?
读取目录树的源码如下:
private void ShowDataWithTreeView() { try { foreach (DataRow dr in dt.Rows) { if (dr["BRANCHLEVEL"].ToString() == "0") { TreeNode tt = tvBox.Nodes.Add(dr["NAME"].ToString()); tt.Name = dr["TREEELEMID"].ToString(); AddTree(dr["TREEELEMID"].ToString(), tt); } } } catch { MessageBox.Show("请先登录数据库!"); } }
时间段的源码如下:
private void BegainTime() { string time = this.dateTimePicker1.Value.ToString("yyyyMMdd"); time+=numericUpDown1.Value.ToString(); time +=numericUpDown2.Value.ToString(); time +=numericUpDown3.Value.ToString(); rtxBox.Text = time; } private void FinishTime() { string time = this.dateTimePicker2.Value.ToString("yyyyMMdd"); time += numericUpDown6.Value.ToString(); time += numericUpDown5.Value.ToString(); time += numericUpDown4.Value.ToString(); rtxBox.Text = time; } 展开
读取目录树的源码如下:
private void ShowDataWithTreeView() { try { foreach (DataRow dr in dt.Rows) { if (dr["BRANCHLEVEL"].ToString() == "0") { TreeNode tt = tvBox.Nodes.Add(dr["NAME"].ToString()); tt.Name = dr["TREEELEMID"].ToString(); AddTree(dr["TREEELEMID"].ToString(), tt); } } } catch { MessageBox.Show("请先登录数据库!"); } }
时间段的源码如下:
private void BegainTime() { string time = this.dateTimePicker1.Value.ToString("yyyyMMdd"); time+=numericUpDown1.Value.ToString(); time +=numericUpDown2.Value.ToString(); time +=numericUpDown3.Value.ToString(); rtxBox.Text = time; } private void FinishTime() { string time = this.dateTimePicker2.Value.ToString("yyyyMMdd"); time += numericUpDown6.Value.ToString(); time += numericUpDown5.Value.ToString(); time += numericUpDown4.Value.ToString(); rtxBox.Text = time; } 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询