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

解决方案 »

  1.   

    检查下有没有一个叫 Login 的窗口。
      

  2.   

    Login login = new Login();没有Login这个窗口,新建一个名为Login的窗体作为登录后的显示窗体!
      

  3.   

    没有 login窗体如何 能用  login.ShowDialog();
      

  4.   

     Login login = new Login()
    你修改了窗口的名称没有?或引用了这个窗口所在的程序集没有?
      

  5.   

    没有Login login=new Login()  窗体  或者窗体名字已修改!!!Q