我想在 datagridview 中加载图像,但到目前为止我只得到文本。
代码
private void button1_Click(object sender, EventArgs e)
{
String name = "LOTUS";
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\xy\\Downloads\\SCA.xls;Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';");
OleDbCommand oconn = new OleDbCommand("Select * From [" + name + "$]", con);
con.Open();
OleDbDataAdapter sda = new OleDbDataAdapter(oconn);
DataTable data = new DataTable();
sda.Fill(data);
dataGridView1.DataSource = data;
}