问题描述
- 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:designvcproject专科医院门诊系统(眼科)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) { } }
}
解决方案
user是关键字,加上方括号
[user]
解决方案二:
你的界面是什么样的?按了按钮了么?
if (radioButton1.Checked == true)有没有走到
解决方案三:
我给你看下我的界面和 access啊 截图给你
解决方案四:
form3是什么
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();
}
看上去这些应该塞在
if (table.Rows.Count > 0)
{
Form f3 = new Form3();
f3.Show();
this.Hide();
}
这个里面
时间: 2024-11-08 20:15:47