using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAL;
using System.Data.SqlClient;
namespace 圖書借閱管理系統
{
public partial class 登陸 : Form
{
public 登陸()
{
InitializeComponent();
}
private void label4_Click(object sender, EventArgs e)
{
}
private void 登陸_Load(object sender, EventArgs e)
{
Random r = new Random();
label4.Text = r.Next(1000, 9999).ToString();
}
private void button1_Click(object sender, EventArgs e)
{
int role;
if(textBox3.Text==label4.Text)
{
if (radioButton1.Checked) role = 0;
else role = 1;
SqlParameter[] p ={
new SqlParameter("@UserName",textBox1.Text),
new SqlParameter("@PassWord",textBox2.Text),
new SqlParameter("@Role",role)
};
SqlDataReader dr=SQLHELPER.(到這就提示不存在sqlhelp)
}
}
}
}
注意sqlhelper裡的namespace是不是namespace 圖書借閱管理系統
如果不是,加上對應的using