由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值
try{
double imoney = Convert.ToDouble(this.txtimoney.Text);
double rmoney = Convert.ToDouble(this.txtrmoney.Text);
string times = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
string sql = "insert into customertable values('" + this.ddlname.Text + "','" + this.txtclientco.Text + "','" + this.txtclientitem.Text + "'," + imoney + ",'" + this.txtclienttime.Text + "'," + rmoney + ",'" + this.txtrtime.Text + "','" + this.txtnum.Text + "','" + this.ddlxiaozu.Text + "','" + times + "')";
SqlConnection conn = new SqlConnection(Common.connection);
conn.Open();
SqlCommand command = new SqlCommand(sql, conn);
int flag = 0;
flag = command.ExecuteNonQuery();
string sql1 = "select count(*) from cnum where cbianhao='" + this.txtnum.Text + "'";
SqlCommand command1 = new SqlCommand(sql1, conn);
SqlDataReader dr1 = command1.ExecuteReader();
int num = 0;
if (dr1.Read())
{
num = Convert.ToInt32(dr1[0]);
dr1.Close();
}
if (num <= 0)
{
string sql2 = "insert into cnum values('" + txtnum.Text + "')";
SqlCommand command2 = new SqlCommand(sql2,conn);
command2.ExecuteNonQuery();
}
if (flag > 0)
{
Response.Redirect("hit.aspx");
}
else
{
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('添加失败请重新检查不要非法操作')" + "</scirpt>");
}
conn.Close();
}
catch (Exception ex)
{
string message = ex.Message.ToString();
Response.Write("<script language='javascript'>alert('" + message + "')" + "</script>");
}
}
由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值