大家好,请大家帮我看看为什么我做的登录后台码无法将填写的内容写入数据库。
数据库连接正常,数据库操作语句也正常。请高手指点。
        SqlConnection sqlCnn = new SqlConnection(strCnn);
        sqlCnn.Open();        SqlCommand check = new SqlCommand("select * from User_Login where User_ID='" + User_ID + "'", sqlCnn);        if (check.ExecuteScalar() == null)
        {            SqlCommand sqlCmd1 = new SqlCommand("insert into User_Login values('" + User_ID + "','" + User_PWD + "')", sqlCnn);
            SqlCommand sqlCmd2 = new SqlCommand("insert into User_Data values('" + User_ID + "','" + User_Name + "','" + User_Sex + "'," + User_Age_Year + "," + User_Age_Month + "," + User_Age_Day + ",'','','','')", sqlCnn);            sqlCnn.Close();            Response.Redirect("Default.aspx");        }是否因为我连用两个数据库命令呢?还是什么其他的原因?