图示:
===========form1的代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace WindowsApplication1
{
public
partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void linkLabel1_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
{
//下载dotnetfx2.0
string neturl = "http://blog.sina.com.cn/s/blog_5e2bdcdb0100dp89.html";
System.Diagnostics.Process.Start(neturl);
}
private void button1_Click(object sender, EventArgs e)
{
//开始删除
string time1 = this.dateTimePicker1.Text.ToString().Replace('年',
'-').Replace('月', '-').Replace('日', ' ') + "23:00:00";
DialogResult result = MessageBox.Show("时间设定为"+ time1 +",确定删除吗?",
"提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (result == DialogResult.Yes)
{
if (this.radioButton1.Checked)
{
//acc,数据库就有问题了,数据库内的时间数据并不是以时间格式存放,因此无法使用<
小于号进行比较
string filepath = this.textBox_acc.Text.ToString().Trim();
int exe = 0;
try
{
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + filepath + ";Persist Security Info=True";