Shahbaz Kaware

Shahbaz Kaware

  • NA
  • 535
  • 31.4k

how should i retrieve image in image control using this code

Mar 22 2017 6:02 AM
Byte[] bytes = null;
string text2 = this.FileUploadFullR.FileName;
string str7 = this.Session["ProductIDA"].ToString();
this.Ade = this.Session["ProductIDA"].ToString();
if (this.FileUploadFullR.HasFile)
{
string filename = FileUploadFullR.PostedFile.FileName;
string str9 = str6 + str4;
string filePath = Path.GetFileName(filename);
Stream fs = FileUploadFullR.PostedFile.InputStream;
BinaryReader br = new BinaryReader(fs);
bytes = br.ReadBytes((Int32)fs.Length);
ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
connection = new SqlConnection(this.strConnectionstring);
connection.Open();
SqlCommand cmdddd = new SqlCommand("Update TBL_PRODUCTDETAILS Set Picfront = @Picfront where ID = '" + str6 + "' ", connection);
cmdddd.Parameters.Add("@Picfront", SqlDbType.Binary).Value = bytes;
cmdddd.ExecuteNonQuery();
}

Answers (1)