qq_27410413 2015-04-21 10:52 采纳率: 0%
浏览 1666
已采纳

from错误求帮忙改下啊

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace 专科医院门诊系统_眼科_
{

public partial class 主界面 : Form
{
    OleDbDataAdapter adapter;
    DataTable table = new DataTable();
    string str = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\design\vc\project\专科医院门诊系统(眼科)\db1.accdb";
    OleDbConnection con = new OleDbConnection();
    public 主界面()
    {
        InitializeComponent();
        button1.Click += new EventHandler(button1_Click);
        button2.Click += new EventHandler(button2_Click);
    }
    private void textbox1_TextChanged(object sender, EventArgs e)
    {
    }
    private void textbox2_TextChanged(object sender, EventArgs e)
    {
    }
    private void radioButton1_Checked(object sender, EventArgs e)
    {
    }
    private void radioButton2_Checked(object sender, EventArgs e)
    {
    }
    private void radioButton3_Checked(object sender, EventArgs e)
    {
    }
    private void radioButton4_Checked(object sender, EventArgs e)
    {
    }
    private void button1_Click(object sender, EventArgs e)
    {
        if (textbox1.Text != "" && textbox2.Text != "")
        {
            string sql = "select * from user where ID=" + textbox1.Text + " and [password]='" + textbox2.Text + "'";
            adapter = new OleDbDataAdapter(sql, str);
            OleDbCommandBuilder buider = new OleDbCommandBuilder(adapter);
            adapter.InsertCommand = buider.GetInsertCommand();
            table.Clear();
            adapter.Fill(table);
            if (table.Rows.Count > 0)
            {
                Form f3 = new Form3();
                f3.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("用户名或密码不能空");
            }

        }
        if (radioButton1.Checked == true)
        {
            this.Hide();
            new 医生调取就诊号界面().ShowDialog();
        }
        else if (radioButton2.Checked == true)
        {
            this.Hide();
            new 挂号缴费选择界面().ShowDialog();
        }
        else if (radioButton3.Checked == true)
        {
            this.Hide();
            new 药房人员调取就诊号界面().ShowDialog();
        }
        else if (radioButton4.Checked == true)
        {
            this.Hide();
            new 医导查询界面().ShowDialog();
        }
    }
    private void button2_Click(object sender, EventArgs e)
    {
        textbox1.Text = textbox2.Text = string.Empty;
    }

    private void 主界面_Load(object sender, EventArgs e)
    {

    }


}

}

图片说明

  • 写回答

4条回答 默认 最新

  • threenewbee 2015-04-21 11:27
    关注

    user是关键字,加上方括号
    [user]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测