A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
Hi @Donald Symmons ,
In fact, I think you don't think the problem is so complicated, since you have a way to upload local files to achieve the function, then we can save the image files in the database to the local first.
string DownLoadFileName;
public void DownLoadPicture()
{
if (DownLoadFileName == "")
{
MessageBox.Show("Enter a file name");
return;
}
SqlConnection conn = GetConn();
string sqlstr = string.Format("your sql command");
SqlCommand comm = new SqlCommand(sqlstr, conn);
comm.Parameters.AddWithValue("@fileName", this.DownLoadFileName);
SqlDataReader datereader = comm.ExecuteReader();
if (datereader.HasRows)
{
if (datereader.Read())
{
this.picture = (byte []) dr["Picture"];
FileStream fs = new FileStream(DownLoadFileName, FileMode.Create, FileAccess.Write);
fs.Write(picture, 0, picture.Length);
fs.Close();
dr.Close();
conn.Close();
}
}//if
else
{
MessageBox.Show("None");
return;
}
}
}
}
Best Regards,
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.