ASP.NET健康饮食管理系统(7)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-12-23 点击数:21839

计算机毕业设计源代码管理2:

以下是引用片段:

 if (myPhoto.ContentLength <= 0)
            {
                //修改指定的健康网信息 没图片
                DataControl.ExecSql("update HBXX  set Xxbt='" + this.TextBox1.Text.Trim() + "',XXnr='" + this.Textbox3.Text.Trim() + "',XXlb='" + this.DropDownList1.SelectedItem.Text + "',fbsj='" + this.TextBox4.Text.Trim() + "' where Xxid=" + Session["ID"].ToString());
            }
            else
            {
                //修改 处理图片数据到二进制数组 然后存储在数据库中
                string[] temp = myPhoto.FileName.Split('.');
                string strHzm = "." + temp[temp.Length - 1];
                string Sql;
                Sql = "update HBXX  set xxbt='" + this.TextBox1.Text.Trim() + "', Xxtp=@myPhotoArray, XXnr='" + this.Textbox3.Text.Trim() + "',XXlb='" + this.DropDownList1.SelectedItem.Text + "',fbsj='" + this.TextBox4.Text.Trim() + "' where Xxid=" + Session["ID"].ToString();
                SqlConnection tmpCnn = new SqlConnection();
                tmpCnn = DataControl.CrConn();
                if (tmpCnn.State != 0)
                {
                    tmpCnn.Close();
                }
                tmpCnn.Open();
                SqlCommand cmd = new SqlCommand(Sql, tmpCnn);
                cmd.Parameters.Add("@myPhotoArray", myPhotoArray);
                cmd.ExecuteNonQuery();
            }

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第8页为计算机毕业论文测试说明......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网