protected void transfer_Click(object sender, EventArgs e) { string sellerId = Session["sellerId"].ToString(); Bitmap uploadedFPImage = new Bitmap(FPFU.PostedFile.InputStream); byte[] data; using (MemoryStream stream = new MemoryStream()) { uploadedFPImage.Save(stream, System.Drawing.Imaging.ImageFormat.Png); data = stream.ToArray(); } BsonDocument doc = operations.findByFingerprint(data); if (doc != null) { double transferAmount = Convert.ToDouble(Cost_txtbox.Text); operations.newTransaction(sellerId, doc["pilgrimId"].AsString, transferAmount); testCompare.Text = "Transaction completed successfully"; } else { testCompare.Text = "There is no pilgrim with this fingerprint!"; } }