日期:2014-05-18 浏览次数:21194 次
                        druser.Dispose();
                         SqlCommand cmdTime = new SqlCommand("select datediff(hour,firsttime,GETDATE()) FROM tb_user where usernum='" + str + "' ", con);
                        textBox1.Text = cmdTime.ExecuteScalar().ToString();
                        int sj = Convert.ToInt32(textBox1.Text);
                        SqlCommand cmdclear = new SqlCommand("updata tb_user set firsttime='" + now + "',sum=sum+sj where usernum='" + str + "'", con);
                        cmdclear.ExecuteScalar();/*运行到这时出现  “System.Data.SqlClient.SqlException”类型的未经处理的异常出现在 System.Data.dll 中。
其他信息: '=' 附近有语法错误。*/
                        con.Close();