i have a database (access database) which contains id and img
column .The id column contains ID'S and img column contains their
respective images.
When the user selects a particular ID at runtimes the
picturebox should display the corresponding image...
However the problem is how to achieve this ?
Coz the Column img datatype is Text .
So do we need to
convert it into image type ?? how to do this...
private void Form1_Load(object sender, EventArgs e)
{
OleDbDataReader dr = null;
OleDbConnection con = new OleDbConnection(" ");
OleDbCommand cmd = new OleDbCommand("Select * from image1", con); // image1 is the name of the table
if (con.State == ConnectionState.Closed)
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
comboBox1.Items.Add(dr["ID"]);
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
OleDbDataReader dr = null;
OleDbConnection con1 = new OleDbConnection(" ");
OleDbCommand cmd1 = new OleDbCommand("Select img from image1 where id = " + comboBox1.SelectedValue,con1);
if (con1.State == ConnectionState.Closed)
con1.Open()
} // HOW TO PROCEED FURTHER ????