|
|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
private void button1_Click(object sender, System.EventArgs e)
{
Form form1=new Form1();
string nian="'"+textBox1.Text+"'";
string yue="'"+textBox2.Text+"'";
string ri="'"+textBox3.Text+"'";
string time="'"+textBox4.Text+"'";
string item="'"+textBox5.Text+"'";
string insertText="("+nian+","+yue+","+ri+","+time+","+item+")";
string insert="INSERT INTO bwl(年,月,日,时间,事件)VALUES"+insertText;
form1.oleDbConnection.Open();
form1.oleDbInsertCommand1=new OleDbCommand(insert,form1.oleDbConnection1);
form1.oleDbInsertCommand1.ExecuteNonQuery();
form1.oleset1.Clear();
form1.oleDbConnection.Close();
}
//编译器说System.Windows.Forms.From不包含对form1.后面的东西那该怎么办
|
|