我有 PostgreSQL 9.2,有这张表:
CREATE TABLE "Task"
(
"taskID" serial NOT NULL,
"taskType" text NOT NULL,
"taskComment" text NOT NULL,
"taskDate" date NOT NULL,
"taskeImage" bytea,
CONSTRAINT "Task_pkey" PRIMARY KEY ("taskID")
)
该表已被记录填充。我只想阅读taskeImage
并在pictureBox1
.
这是我的尝试:
//some initial code goes here
NpgsqlDataReader dr = command.ExecuteReader();
dr.Read();
pictureBox1.Image=dr[4];
conn.Close();