0
我有一個基本的搜索功能,所以基本上你搜索一個醫生的名字,e.g「鮑勃」和他們的第一個名字,姓氏和他們的照片。但我想要做的是將圖像的URL存儲在數據庫中,並在醫生姓名被搜索時以某種方式將該圖像顯示在PictureBox中。負荷URL(存儲在數據庫URL)圖像到PictureBox的
到目前爲止,這是我:
MySqlConnection con = new MySqlConnection("server=localhost;user id=root;database=docdatabase");
string Query = ("SELECT * FROM doctors WHERE FirstName='" + textBox1.Text + "'");
con.Open();
MySqlCommand command = new MySqlCommand(Query, con);
MySqlDataReader mdr = command.ExecuteReader();
if (mdr.Read())
{
textBox2.Text = (mdr["FirstName"].ToString());
textBox3.Text = (mdr["LastName"].ToString());
textBox4.Text = (mdr["Verified"].ToString());
pictureBox1.Image = (mdr["Cert"].ToString()); //The Image
}
else
{
MessageBox.Show("No doctor by that name! Try again.");
}