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 WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Conn con = new Conn(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, this.textBox4.Text);
SqlConnection sqlConnection = con.creatConn();
SqlCommand cmd=new SqlCommand("select count(*) from Users where UserName='"+textBox5.Text+"'and Password='"+this.textBox6.Text+"'",sqlConnection);
string t=cmd.ExecuteScalar().ToString();
if(t=="1")
{
this.Visible =false ;
Login login = new Login();
login.ShowDialog();
}
else
{
MessageBox.Show("登录失败","提醒");
}
}
}
}
错误 1 未能找到类型或命名空间名称“Login”(是否缺少 using 指令或程序集引用?) D:\新建文件夹\WindowsFormsApplication6\WindowsFormsApplication6\Form1.cs 29 17 WindowsFormsApplication6
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 WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Conn con = new Conn(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, this.textBox4.Text);
SqlConnection sqlConnection = con.creatConn();
SqlCommand cmd=new SqlCommand("select count(*) from Users where UserName='"+textBox5.Text+"'and Password='"+this.textBox6.Text+"'",sqlConnection);
string t=cmd.ExecuteScalar().ToString();
if(t=="1")
{
this.Visible =false ;
Login login = new Login();
login.ShowDialog();
}
else
{
MessageBox.Show("登录失败","提醒");
}
}
}
}
错误 1 未能找到类型或命名空间名称“Login”(是否缺少 using 指令或程序集引用?) D:\新建文件夹\WindowsFormsApplication6\WindowsFormsApplication6\Form1.cs 29 17 WindowsFormsApplication6
你修改了窗口的名称没有?或引用了这个窗口所在的程序集没有?