楼主,把Console.ReadLine();
放到con.Close();后面去

解决方案 »

  1.   

    硬度不够
    ------
    用try{
    //你的代码
    }
    catch(Exception e){Console.writeLine(e.ToString());}
    看看异常是什么?
      

  2.   

                String sqlstring = "server='2012-20130515XX\\SQLEXPRESS';database='dbFM';Integrated Security=True";
                SqlConnection con = new SqlConnection(sqlstring);
                con.Open();           
                String str = "INSERT INTO [User] (Userid,Username ,Upassword,Uemail) VALUES ('12345'  ,'dfsdfsf'   ,'ffsf','fgfdgd')";
                SqlCommand comm = new SqlCommand(str,con);
                comm.ExecuteNonQuery();
                con.Close();