protected void Unnamed1_Click(object sender, EventArgs e)
{
string Sql = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
SqlConnection con = new SqlConnection(Sql);
con.Open();
//FileStream fs = File.Open(Server.MapPath( "img/"+ this.FileUpload1.PostedFile.FileName), FileMode.Open);
//byte[] by = new byte[fs.Length];
//fs.Read(by, 0, (int)fs.Length);
string SqlCmd = "insert into ImageStore(ImageData,ImageContentType,ImageDescription,ImageSize) values(@Image,@fileType,@fileDec,@fileSize)";
SqlCommand comobj = new SqlCo
以数据流的形式上传上传数据存入数据库
最新推荐文章于 2025-04-22 10:20:09 发布