【发布时间】:2013-02-07 00:34:02
【问题描述】:
我目前正在尝试使用此代码将图像保存到我的数据库中:
byte[] myimage = new byte[FileUpload1.PostedFile.ContentLength];
HttpPostedFile Image = FileUpload1.PostedFile;
Image.InputStream.Read(myimage, 0, (int)FileUpload1.PostedFile.ContentLength);
string id = txtScanId.Text;
cmd1.CommandText = "INSERT INTO TABLE(AssetImage) VALUES (@Image)";
cmd1.Connection = con1;
con1.Open();
cmd1.ExecuteNonQuery();
但我得到了错误:
必须声明标量变量“@Image”
谁能帮忙,我已经做了 6 个小时了!
谢谢!
【问题讨论】: