错误代码请高手赐教
public partial class Form1 : Form
{
private string conStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\lixin\\1.mdb";
OleDbConnection con = null;
public Form1()
{
InitializeComponent();
}
public void Connetion()
{
try
{
con = new OleDbConnection(conStr);
con.Open();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
public void Funtion(string sqlStr)
{
try
{
OleDbCommand comm = new OleDbCommand(sqlStr, con);
comm.ExecuteNonQuery();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
private void Close()
{
try
{
con.Close();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
string sqlStr = "update Me set Me.Sex=Student.sex from Student ,Me where Me.Name=Student.Name";
Connetion();
Funtion(sqlStr);
Close();
}
这是全部代码,为啥那个SQL语句执行时总是错呢,请各位高手帮帮我!它总是提示语法错误,操作符丢失!谢谢了!