用Image 类型
下面是部分代码 private void addFile()
{
byte [] byteread;
byteread = GetBytesFromDisk(dlgOpen.FileName);
command.CommandText = "INSERT INTO FileManage (fileData) " +
"values( ?)";
command.Parameters.Add("fileData", byteread);
ExecuteNonQuery();
}
private byte[] GetBytesFromDisk(string Path)
{
byte [] bytes;
FrmMain.frmmain.Cursor = Cursors.WaitCursor;
try
{
FileStream fr = new FileStream(Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
int FileSize = Convert.ToInt32(fr.Length);
if (FileSize == 0)
{
throw new Exception("导入文件大小为0字节");
}
bytes =new byte[FileSize] ;
fr.Read(bytes,0,FileSize); 
}
finally
{
FrmMain.frmmain.Cursor = Cursors.Default;
} return bytes;
}