我需要用图像更新 sql 表中的一行。该行已经包含 ID、名称、类型等。但是当我使用下面的更新时,我将“System.Windows.Controls.Image”插入到该行中。
partner.AdImageUrl = uri.ToString();//"url + name"
sc.Open();
//cmd = new SqlCommand("Update Table1 set Name = '" + this.txtName.Text + "', AdType = '" + txttype + "', AdImageUrl = '" + imaPartners + "', Description = '" + txtDesc + "' where Name = '" + this.txtName.Text + "'");
cmd = new SqlCommand("Update Table1 Set AdImageUrl= '" + imaPartners +"' where Name = '" + this.txtName.Text + "'", sc);
cmd.Connection = sc;
cmd.ExecuteNonQuery();