چجوری میتونم تو یک کوئری تکستی اینکارو انجام بدم؟
byte[] imgs;
string query=string.format("insert into table1 (id, image) values ({0}, {1})",2,imgs);
اما این خطا میگیره :(
چجوری میتونم تو یک کوئری تکستی اینکارو انجام بدم؟
byte[] imgs;
string query=string.format("insert into table1 (id, image) values ({0}, {1})",2,imgs);
اما این خطا میگیره :(
می خوام عکسی رو که از sql server جستجو کردم تو یه picture box نشون بدم. برای اینکارbuffer1 = (byte[])(objdataset.Tables["tbl_caramuz"].Rows[objcm.Position]["pic"]);
کد زیر رو می نویسم
MemoryStream objstream = new MemoryStream(buffer1);
PictureBox objbox =PictureBox1;
objbox.Image = Image.FromStream(objstream);
objbox = null;
objstream.Close();
اما error زیر رو میده
Unable to cast object of type ‘system.DBNull’ to type ‘system.Byte[]’