日期:2014-05-17 浏览次数:20463 次
double bHotPrice1 =Convert.ToDouble((FormView1.FindControl("Sgq_bHotPriceLabel") as Label).Text);如何把红色的float变量插入到数据库中?
float bHotPrice[/color = (float)bHotPrice1;
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Sgq_DBConnectionString"].ConnectionString.ToString()))
{
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "insert into Sgq_Car_Order(Sgq_uName,Sgq_bName,Sgq_bISBN,Sgq_bHotPrice) values ('uName','bName','bISBN',[color=#FF99CC]bHotPrice)";
cmd.ExecuteNonQuery();
Response.Write("<script>alert('该书已经加入购物车!若要查看请点击购物车!')</script>");
}
}