private void button1_click(object sender, EventArgs e)
{
string str = @"Data source=SKY-20150803NSI;initial catalog=音乐管理;User ID=471388299;Password=710407asd";
SqlConnection conn = new SqlConnection(str);
conn.Open();
string sql = "Select* from用户表 where 用户名='" + textBox1.Text + "'and 密码='" + textBox2.Text + "'";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.CommandType = CommandType.Text;
SqlDataReader ada = cmd.ExecuteReader();
if (ada.Read())
{
if (this.身份.SelectedItem.ToString() == "管理员")
{
this.Hide();
admin admin = new admin();
admin.Show();
}
if (this.身份.SelectedItem.ToString() == "一般用户")
{
this.Hide();
user user = new user();
user.Show();
}
}
else
{
MessageBox.Show("信息有误,请重新输入");
}
各位大神,小弟刚学C#制作了一个数据库的登录界面,但每次运行都会显示“System.NotImplementedException”类型的未经处理的异常在 WindowsFormsApplication4.exe 中发生 我实在不知道什么方面错误了。这究竟是什么问题,要怎么解决。。还有如果小弟本身代码有误也请指出。。另:大神别嫌我代码写的乱。。。。。。。。。。