Dispose(bool)”: 没有找到适合的方法来重写
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
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.SqlClient;
namespace libraryMIS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
libraryMS con = new libraryMS(justice,sa,libraryMIS,justicer);
SqlConnection sqlconnection = con.creatlibraryMS;
SqlCommand cmd = new SqlCommand("SELECT COUNT(*) FROM person WHERE Name='" + textName + "' and Pwd='" + textPassWord + "'", sqlConnection);
string t = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
if (t == "1")
{
this.Visible = false;
person person = new person();
person.ShowDialog();
}
else
{
MessageBox.Show("登录失败","友情提示");
}
}
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
主要是告诉我如何解决这个问题,谢谢!
说明一下libraryMS是已经定义好的一个连接数据库的类 展开
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.SqlClient;
namespace libraryMIS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
libraryMS con = new libraryMS(justice,sa,libraryMIS,justicer);
SqlConnection sqlconnection = con.creatlibraryMS;
SqlCommand cmd = new SqlCommand("SELECT COUNT(*) FROM person WHERE Name='" + textName + "' and Pwd='" + textPassWord + "'", sqlConnection);
string t = cmd.ExecuteScalar().ToString();
cmd.Connection.Close();
if (t == "1")
{
this.Visible = false;
person person = new person();
person.ShowDialog();
}
else
{
MessageBox.Show("登录失败","友情提示");
}
}
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
主要是告诉我如何解决这个问题,谢谢!
说明一下libraryMS是已经定义好的一个连接数据库的类 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询