The issue is solved. I added a new Action method in Controller:
public ActionResult GetImage(int id)
{
string conStr = "Data Source=.\\SQLEXPRESS; Initial Catalog=Nettbutikk; Integrated Security=True";
SqlConnection con = new SqlConnection(conStr);
con.Open();
SqlDataAdapter dataAdapter = new SqlDataAdapter(new SqlCommand("select * from products", con));
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
Byte[] data = new Byte[0];
data = (Byte[])(dataSet.Tables[0].Rows[0]["picture"]);
return File(data, "image/jpg");
}
and then calling this method in View:
<img src="@Url.Action("GetImage", new { id = 1 })" alt="Northern Lights" width="600" height="400">