using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Imaging;
using System.Data.OleDb;
using Microsoft.VisualBasic;
namespace proposed_embed_system
{
public partial class Form4 : Form
public Form4()
InitializeComponent();
}
OleDbConnection con;
OleDbCommand cmd;
OleDbDataAdapter adapter;
DataSet ds;
int rno = 0;
MemoryStream ms;
byte[] photo_aray;
private void Form4_Load(object sender, EventArgs e)
con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Embed system\\ATM.mdb");
loaddata();
showdata();
void loaddata()
adapter = new OleDbDataAdapter("select * from atm", con);
ds = new DataSet();
adapter.Fill(ds, "atm");
void showdata()
accountBox.Text = ds.Tables[0].Rows[rno][0].ToString();
pictureBox3.Image = null;
if (ds.Tables[0].Rows[rno][4] != System.DBNull.Value)
photo_aray = (byte[])ds.Tables[0].Rows[rno][4];
MemoryStream ms = new MemoryStream(photo_aray);
pictureBox3.Image = Image.FromStream(ms);
private void enterbtn_Click(object sender, EventArgs e)
try
int n = Convert.ToInt32(Interaction.InputBox("Enter Account No:", "Search", "20", 100, 100));
DataRow drow;
drow = ds.Tables[0].Rows.Find(n);
if (drow != null)
rno = ds.Tables[0].Rows.IndexOf(drow);
if (drow[4] != System.DBNull.Value)
photo_aray = (byte[])drow[4];
else
MessageBox.Show("Record Not Found");
catch
MessageBox.Show("Invalid Input");