MySQL 데이터베이스에서 LONGBLOB을 검색하려고하지만 어떻게해야할지 모르겠다. 나는 interwebz를 수색했고, 정말로 도움이되는 (이해할 수있는) 아무것도 발견되지 않았다. LONGBLOB을 검색 할 때이를 이미지로 저장하려고합니다. C#의 MySQL에서 LONGBLOB 검색
이
내가 이미 뭘하려 : 사전에 int bufferSize = 100;
byte[] bin = new byte[bufferSize];
long retval = 0;
long startIndex = 0;
MemoryStream ms = null;
Image image = null;
MySqlCommand command = new MySqlCommand("select * from image where uid = @uid", Connection.Connect());
command.Parameters.AddWithValue("@uid", "2");
MySqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
retval = reader.GetBytes(reader.GetOrdinal("logo"), startIndex, bin, 0, bufferSize);
}
ms = new MemoryStream(bin);
image = Image.FromStream(ms);
감사합니다.
얻기에 오류 : 이미지 = Image.FromStream (밀리 초); (매개 변수가 유효하지 않습니다). –