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 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多